510bcc2
diff -up openssl-1.1.0-pre6/crypto/asn1/a_verify.c.no-md5-verify openssl-1.1.0-pre6/crypto/asn1/a_verify.c
510bcc2
--- openssl-1.1.0-pre6/crypto/asn1/a_verify.c.no-md5-verify	2016-08-04 16:00:45.000000000 +0200
510bcc2
+++ openssl-1.1.0-pre6/crypto/asn1/a_verify.c	2016-08-08 16:01:38.382424922 +0200
510bcc2
@@ -7,6 +7,9 @@
510bcc2
  * https://www.openssl.org/source/license.html
9caf868
  */
9caf868
 
9caf868
+/* for secure_getenv */
9caf868
+#define _GNU_SOURCE
9caf868
+
9caf868
 #include <stdio.h>
9caf868
 #include <time.h>
9caf868
 
510bcc2
@@ -129,6 +132,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);