aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_cryptobox.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/lua_cryptobox.c')
-rw-r--r--src/lua/lua_cryptobox.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lua/lua_cryptobox.c b/src/lua/lua_cryptobox.c
index 0fa9e23c1..721d71256 100644
--- a/src/lua/lua_cryptobox.c
+++ b/src/lua/lua_cryptobox.c
@@ -1393,7 +1393,12 @@ lua_cryptobox_hash_copy(const struct rspamd_lua_cryptobox_hash *orig)
(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30500000)
/* XXX: dunno what to do with this ancient crap */
#else
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
nhash->content.hmac_c = EVP_MAC_CTX_dup(orig->content.hmac_c);
+#else
+ nhash->content.hmac_c = HMAC_CTX_new();
+ HMAC_CTX_copy(nhash->content.hmac_c, orig->content.hmac_c);
+#endif
#endif
}
else if (orig->type == LUA_CRYPTOBOX_HASH_BLAKE2) {