Blame SOURCES/openssl-1.0.2a-fips-md5-allow.patch

cfec1a
diff -up openssl-1.0.2a/crypto/md5/md5_dgst.c.md5-allow openssl-1.0.2a/crypto/md5/md5_dgst.c
cfec1a
--- openssl-1.0.2a/crypto/md5/md5_dgst.c.md5-allow	2015-04-09 18:18:36.505393113 +0200
cfec1a
+++ openssl-1.0.2a/crypto/md5/md5_dgst.c	2015-04-09 18:18:32.408298469 +0200
cfec1a
@@ -72,7 +72,16 @@ const char MD5_version[] = "MD5" OPENSSL
cfec1a
 #define INIT_DATA_C (unsigned long)0x98badcfeL
cfec1a
 #define INIT_DATA_D (unsigned long)0x10325476L
cfec1a
 
cfec1a
-nonfips_md_init(MD5)
cfec1a
+int MD5_Init(MD5_CTX *c)
cfec1a
+#ifdef OPENSSL_FIPS
cfec1a
+{
cfec1a
+    if (FIPS_mode() && getenv("OPENSSL_FIPS_NON_APPROVED_MD5_ALLOW") == NULL)
cfec1a
+        OpenSSLDie(__FILE__, __LINE__, "Digest MD5 forbidden in FIPS mode!");
cfec1a
+    return private_MD5_Init(c);
cfec1a
+}
cfec1a
+
cfec1a
+int private_MD5_Init(MD5_CTX *c)
cfec1a
+#endif
cfec1a
 {
cfec1a
     memset(c, 0, sizeof(*c));
cfec1a
     c->A = INIT_DATA_A;