summaryrefslogtreecommitdiff
path: root/libarchive/archive_hmac_private.h
diff options
context:
space:
mode:
authorMartin Matuska <martin@matuska.de>2022-12-09 14:23:14 +0100
committerMartin Matuska <martin@matuska.de>2022-12-09 14:26:20 +0100
commit4dc59629106890354e0a1ecec5ee3b8e6846f324 (patch)
tree34dff7c07b13c14d77216090cb06d6fd900040e8 /libarchive/archive_hmac_private.h
parent9add75fa4067026cabd50d434eb7f1ebf9d3d7c0 (diff)
downloadlibarchive-4dc59629106890354e0a1ecec5ee3b8e6846f324.tar.gz
archive_hmac: use EVP_MAC_*() in OpenSSL 3.0
HMAC_*() functions have been deprecated since OpenSSL 3.0
Diffstat (limited to 'libarchive/archive_hmac_private.h')
-rw-r--r--libarchive/archive_hmac_private.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libarchive/archive_hmac_private.h b/libarchive/archive_hmac_private.h
index 13a67d49..50044a04 100644
--- a/libarchive/archive_hmac_private.h
+++ b/libarchive/archive_hmac_private.h
@@ -74,9 +74,16 @@ typedef mbedtls_md_context_t archive_hmac_sha1_ctx;
typedef struct hmac_sha1_ctx archive_hmac_sha1_ctx;
#elif defined(HAVE_LIBCRYPTO)
+#include <openssl/opensslv.h>
+#include <openssl/hmac.h>
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+typedef EVP_MAC_CTX *archive_hmac_sha1_ctx;
+
+#else
#include "archive_openssl_hmac_private.h"
typedef HMAC_CTX* archive_hmac_sha1_ctx;
+#endif
#else