Blame SOURCES/openssl-1.1.1-no-weak-verify.patch

782d48
diff -up openssl-1.1.1b/crypto/asn1/a_verify.c.no-weak-verify openssl-1.1.1b/crypto/asn1/a_verify.c
782d48
--- openssl-1.1.1b/crypto/asn1/a_verify.c.no-weak-verify	2019-02-26 15:15:30.000000000 +0100
782d48
+++ openssl-1.1.1b/crypto/asn1/a_verify.c	2019-02-28 11:25:31.531862873 +0100
e4b8d1
@@ -7,6 +7,9 @@
e4b8d1
  * https://www.openssl.org/source/license.html
e4b8d1
  */
e4b8d1
 
e4b8d1
+/* for secure_getenv */
e4b8d1
+#define _GNU_SOURCE
e4b8d1
+
e4b8d1
 #include <stdio.h>
e4b8d1
 #include <time.h>
e4b8d1
 #include <sys/types.h>
782d48
@@ -130,6 +133,12 @@ int ASN1_item_verify(const ASN1_ITEM *it
e4b8d1
         if (ret != 2)
e4b8d1
             goto err;
e4b8d1
         ret = -1;
e4b8d1
+    } else if ((mdnid == NID_md5
e4b8d1
+               && secure_getenv("OPENSSL_ENABLE_MD5_VERIFY") == NULL) ||
e4b8d1
+               mdnid == NID_md4 || mdnid == NID_md2 || mdnid == NID_sha) {
e4b8d1
+        ASN1err(ASN1_F_ASN1_ITEM_VERIFY,
e4b8d1
+                ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
e4b8d1
+        goto err;
e4b8d1
     } else {
782d48
         const EVP_MD *type = EVP_get_digestbynid(mdnid);
782d48