aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_cryptobox.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-05-16 23:24:08 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-05-16 23:24:08 +0100
commit7a357eded768fd4248214d95dac5b1216f7eb40e (patch)
tree8901814673be7cc6d0dd7e9e5a1530793ff8692f /src/lua/lua_cryptobox.c
parentd1a60a0180dd54d4e30b4482ede8fbf4e25243aa (diff)
downloadrspamd-7a357eded768fd4248214d95dac5b1216f7eb40e.tar.gz
rspamd-7a357eded768fd4248214d95dac5b1216f7eb40e.zip
[Minor] Fix build with LibreSSL 3.5+
Submitted by: Bernard Spil
Diffstat (limited to 'src/lua/lua_cryptobox.c')
-rw-r--r--src/lua/lua_cryptobox.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lua/lua_cryptobox.c b/src/lua/lua_cryptobox.c
index 7c19a7805..e18658d88 100644
--- a/src/lua/lua_cryptobox.c
+++ b/src/lua/lua_cryptobox.c
@@ -1001,7 +1001,8 @@ lua_cryptobox_hash_dtor (struct rspamd_lua_cryptobox_hash *h)
EVP_MD_CTX_destroy (h->content.c);
}
else if (h->type == LUA_CRYPTOBOX_HASH_HMAC) {
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30500000)
HMAC_CTX_cleanup (h->content.hmac_c);
g_free (h->content.hmac_c);
#else
@@ -1059,7 +1060,8 @@ rspamd_lua_ssl_hmac_create (struct rspamd_lua_cryptobox_hash *h, const EVP_MD *h
{
h->type = LUA_CRYPTOBOX_HASH_HMAC;
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30500000)
h->content.hmac_c = g_malloc0 (sizeof(*h->content.hmac_c));
#else
h->content.hmac_c = HMAC_CTX_new ();
@@ -1461,7 +1463,8 @@ lua_cryptobox_hash_reset (lua_State *L)
EVP_DigestInit (h->content.c, EVP_MD_CTX_md (h->content.c));
break;
case LUA_CRYPTOBOX_HASH_HMAC:
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30500000)
/* Old openssl is awesome... */
HMAC_Init_ex (h->content.hmac_c, NULL, 0, h->content.hmac_c->md, NULL);
#else