From: Vsevolod Stakhov Date: Tue, 4 Feb 2020 12:14:33 +0000 (+0000) Subject: [Minor] Sigh, use EVP_DigestInit_ex instead X-Git-Tag: 2.3~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d0c9d19bf9a1e70c32ba34f540670d3eff0f4696;p=rspamd.git [Minor] Sigh, use EVP_DigestInit_ex instead --- diff --git a/src/lua/lua_cryptobox.c b/src/lua/lua_cryptobox.c index f5d66b96f..48d66895c 100644 --- a/src/lua/lua_cryptobox.c +++ b/src/lua/lua_cryptobox.c @@ -965,21 +965,21 @@ rspamd_lua_hash_create (const gchar *type) if (g_ascii_strcasecmp (type, "md5") == 0) { h->type = LUA_CRYPTOBOX_HASH_SSL; h->content.c = EVP_MD_CTX_create (); - EVP_DigestInit (h->content.c, EVP_md5 ()); /* Should never ever be used for crypto/security purposes! */ #ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW EVP_MD_CTX_set_flags (h->content.c, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); #endif + EVP_DigestInit_ex (h->content.c, EVP_md5 (), NULL); } else if (g_ascii_strcasecmp (type, "sha1") == 0 || g_ascii_strcasecmp (type, "sha") == 0) { h->type = LUA_CRYPTOBOX_HASH_SSL; h->content.c = EVP_MD_CTX_create (); /* Should never ever be used for crypto/security purposes! */ - EVP_DigestInit (h->content.c, EVP_sha1 ()); #ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW EVP_MD_CTX_set_flags (h->content.c, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); #endif + EVP_DigestInit_ex (h->content.c, EVP_sha1 (), NULL); } else if (g_ascii_strcasecmp (type, "sha256") == 0) { h->type = LUA_CRYPTOBOX_HASH_SSL;