isaacpittman-hitachi / rpms / openssl

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