aboutsummaryrefslogtreecommitdiff
path: root/drivers/builtin_openssl2/crypto/evp/digest.c
diff options
context:
space:
mode:
authormrezai2016-04-15 19:03:35 +0430
committerRémi Verschelde2016-04-27 08:49:39 +0200
commit3efa0f130dbaaba5eecb42f76ed7518eedfdf0c8 (patch)
tree91da0400f0a1386f7122e25c559abdfb53a9ec9e /drivers/builtin_openssl2/crypto/evp/digest.c
parent47c7b535d2cdcb89c7799475662c70ca9c7ff41d (diff)
downloadgodot-3efa0f130dbaaba5eecb42f76ed7518eedfdf0c8.tar.gz
godot-3efa0f130dbaaba5eecb42f76ed7518eedfdf0c8.tar.zst
godot-3efa0f130dbaaba5eecb42f76ed7518eedfdf0c8.zip
Update OpenSSL to version 1.0.2g
(cherry picked from commit e97922f22038e9049ed4c2db5b3736dfaa0edde3)
Diffstat (limited to 'drivers/builtin_openssl2/crypto/evp/digest.c')
-rw-r--r--drivers/builtin_openssl2/crypto/evp/digest.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/builtin_openssl2/crypto/evp/digest.c b/drivers/builtin_openssl2/crypto/evp/digest.c
index 2e202c8fe..f2643f324 100644
--- a/drivers/builtin_openssl2/crypto/evp/digest.c
+++ b/drivers/builtin_openssl2/crypto/evp/digest.c
@@ -119,6 +119,7 @@
#ifdef OPENSSL_FIPS
# include <openssl/fips.h>
+# include "evp_locl.h"
#endif
void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
@@ -145,6 +146,17 @@ int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
{
EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
+#ifdef OPENSSL_FIPS
+ /* If FIPS mode switch to approved implementation if possible */
+ if (FIPS_mode()) {
+ const EVP_MD *fipsmd;
+ if (type) {
+ fipsmd = evp_get_fips_md(type);
+ if (fipsmd)
+ type = fipsmd;
+ }
+ }
+#endif
#ifndef OPENSSL_NO_ENGINE
/*
* Whether it's nice or not, "Inits" can be used on "Final"'d contexts so