9caf868
diff -up openssl-1.0.1e/crypto/asn1/a_verify.c.no-md5-verify openssl-1.0.1e/crypto/asn1/a_verify.c
9caf868
--- openssl-1.0.1e/crypto/asn1/a_verify.c.no-md5-verify	2013-02-11 16:26:04.000000000 +0100
9caf868
+++ openssl-1.0.1e/crypto/asn1/a_verify.c	2013-11-13 16:30:04.628791616 +0100
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
9caf868
 			goto err;
9caf868
 		ret = -1;
9caf868
 		}
9caf868
+	else if (mdnid == NID_md5 && secure_getenv("OPENSSL_ENABLE_MD5_VERIFY") == NULL)
9caf868
+		{
9caf868
+		ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
9caf868
+		goto err;
9caf868
+		}
9caf868
 	else
9caf868
 		{
9caf868
 		const EVP_MD *type;