a1fb602
diff -up openssl-1.0.2a/crypto/asn1/a_verify.c.no-md5-verify openssl-1.0.2a/crypto/asn1/a_verify.c
a1fb602
--- openssl-1.0.2a/crypto/asn1/a_verify.c.no-md5-verify	2015-04-09 18:20:58.829680829 +0200
a1fb602
+++ openssl-1.0.2a/crypto/asn1/a_verify.c	2015-04-09 18:20:54.495580710 +0200
9caf868
@@ -56,6 +56,9 @@
9caf868
  * [including the GNU Public Licence.]
9caf868
  */
9caf868
 
9caf868
+/* for secure_getenv */
9caf868
+#define _GNU_SOURCE
9caf868
+
9caf868
 #include <stdio.h>
9caf868
 #include <time.h>
9caf868
 
9caf868
@@ -171,6 +174,11 @@ int ASN1_item_verify(const ASN1_ITEM *it
a1fb602
         if (ret != 2)
a1fb602
             goto err;
a1fb602
         ret = -1;
a1fb602
+    } else if (mdnid == NID_md5
a1fb602
+               && secure_getenv("OPENSSL_ENABLE_MD5_VERIFY") == NULL) {
a1fb602
+        ASN1err(ASN1_F_ASN1_ITEM_VERIFY,
a1fb602
+                ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
a1fb602
+        goto err;
a1fb602
     } else {
a1fb602
         const EVP_MD *type;
a1fb602
         type = EVP_get_digestbynid(mdnid);