Merge pull request #10242 from akallabeth/openssl3-md5

[winpr,crypto] OpenSSL3 md5 support
This commit is contained in:
akallabeth 2024-06-04 10:50:34 +02:00 committed by GitHub
commit cf586b4d2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -546,6 +546,15 @@ BOOL winpr_Digest_Init_Allow_FIPS(WINPR_DIGEST_CTX* ctx, WINPR_MD_TYPE md)
}
#if defined(WITH_OPENSSL)
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
if (md == WINPR_MD_MD5)
{
EVP_MD* md5 = EVP_MD_fetch(NULL, "MD5", "fips=no");
BOOL rc = winpr_Digest_Init_Internal(ctx, md5);
EVP_MD_free(md5);
return rc;
}
#endif
const EVP_MD* evp = winpr_openssl_get_evp_md(md);
EVP_MD_CTX_set_flags(ctx->mdctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
return winpr_Digest_Init_Internal(ctx, evp);