From f11d9b9e095bd6b48c03af7d0dc892ddba72f78d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 25 Jan 2025 15:31:12 +0000 Subject: [Minor] Fix for old OpenSSL, sigh --- src/lua/lua_cryptobox.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/lua/lua_cryptobox.c') 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) { -- cgit v1.2.3