Blame SOURCES/openssl-1.0.2k-cve-2018-0732.patch

450916
diff -up openssl-1.0.2k/crypto/dh/dh_key.c.large-dh openssl-1.0.2k/crypto/dh/dh_key.c
450916
--- openssl-1.0.2k/crypto/dh/dh_key.c.large-dh	2018-06-18 13:46:24.268137362 +0200
450916
+++ openssl-1.0.2k/crypto/dh/dh_key.c	2018-06-18 13:59:04.605497462 +0200
450916
@@ -133,7 +133,7 @@ static int generate_key(DH *dh)
450916
     int ok = 0;
450916
     int generate_new_key = 0;
450916
     unsigned l;
450916
-    BN_CTX *ctx;
450916
+    BN_CTX *ctx = NULL;
450916
     BN_MONT_CTX *mont = NULL;
450916
     BIGNUM *pub_key = NULL, *priv_key = NULL;
450916
 
450916
@@ -145,6 +145,11 @@ static int generate_key(DH *dh)
450916
     }
450916
 #endif
450916
 
450916
+    if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) {
450916
+        DHerr(DH_F_GENERATE_KEY, DH_R_MODULUS_TOO_LARGE);
450916
+        return 0;
450916
+    }
450916
+
450916
     ctx = BN_CTX_new();
450916
     if (ctx == NULL)
450916
         goto err;