From 1a673a095c33699643b90e5d6922ebd23f596575 Mon Sep 17 00:00:00 2001 From: Barry de Graaff <4353213+barrydegraaff@users.noreply.github.com> Date: Mon, 19 Jun 2023 14:32:05 +0200 Subject: [PATCH] fix:https://github.com/Cisco-Talos/clamav/issues/564 Allow to use ClamAV on FIPS enabled OpenSSL --- libclamav/crypto.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libclamav/crypto.c b/libclamav/crypto.c index e4824fdb79..b810ec91b1 100644 --- a/libclamav/crypto.c +++ b/libclamav/crypto.c @@ -170,7 +170,7 @@ unsigned char *cl_hash_data(const char *alg, const void *buf, size_t len, unsign size_t cur; int winres = 0; - md = EVP_get_digestbyname(alg); + md = EVP_MD_fetch(NULL, alg, "-fips"); if (!(md)) return NULL; @@ -260,7 +260,7 @@ unsigned char *cl_hash_file_fd(int fd, const char *alg, unsigned int *olen) const EVP_MD *md; unsigned char *res; - md = EVP_get_digestbyname(alg); + md = EVP_MD_fetch(NULL, alg, "-fips"); if (!(md)) return NULL; @@ -392,7 +392,7 @@ int cl_verify_signature_hash(EVP_PKEY *pkey, const char *alg, unsigned char *sig const EVP_MD *md; size_t mdsz; - md = EVP_get_digestbyname(alg); + md = EVP_MD_fetch(NULL, alg, "-fips"); if (!(md)) return -1; @@ -437,7 +437,7 @@ int cl_verify_signature_fd(EVP_PKEY *pkey, const char *alg, unsigned char *sig, if (!(digest)) return -1; - md = EVP_get_digestbyname(alg); + md = EVP_MD_fetch(NULL, alg, "-fips"); if (!(md)) { free(digest); return -1; @@ -506,7 +506,7 @@ int cl_verify_signature(EVP_PKEY *pkey, const char *alg, unsigned char *sig, uns return -1; } - md = EVP_get_digestbyname(alg); + md = EVP_MD_fetch(NULL, alg, "-fips"); if (!(md)) { free(digest); if (decode) @@ -725,7 +725,7 @@ unsigned char *cl_sign_data(EVP_PKEY *pkey, const char *alg, unsigned char *hash unsigned int siglen; unsigned char *sig; - md = EVP_get_digestbyname(alg); + md = EVP_MD_fetch(NULL, alg, "-fips"); if (!(md)) return NULL; @@ -1148,7 +1148,7 @@ void *cl_hash_init(const char *alg) EVP_MD_CTX *ctx; const EVP_MD *md; - md = EVP_get_digestbyname(alg); + md = EVP_MD_fetch(NULL, alg, "-fips"); if (!(md)) return NULL;