summaryrefslogtreecommitdiff
path: root/Utilities/cmlibarchive/libarchive/archive_hmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_hmac.c')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_hmac.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_hmac.c b/Utilities/cmlibarchive/libarchive/archive_hmac.c
index 36e3e1c6fd..7857c0ff35 100644
--- a/Utilities/cmlibarchive/libarchive/archive_hmac.c
+++ b/Utilities/cmlibarchive/libarchive/archive_hmac.c
@@ -31,6 +31,20 @@
#include "archive.h"
#include "archive_hmac_private.h"
+/*
+ * On systems that do not support any recognized crypto libraries,
+ * the archive_hmac.c file is expected to define no usable symbols.
+ *
+ * But some compilers and linkers choke on empty object files, so
+ * define a public symbol that will always exist. This could
+ * be removed someday if this file gains another always-present
+ * symbol definition.
+ */
+int __libarchive_hmac_build_hack(void) {
+ return 0;
+}
+
+
#ifdef ARCHIVE_HMAC_USE_Apple_CommonCrypto
static int
@@ -129,7 +143,7 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx)
}
}
-#elif defined(HAVE_LIBNETTLE)
+#elif defined(HAVE_LIBNETTLE) && defined(HAVE_NETTLE_HMAC_H)
static int
__hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len)