Skip to content

Commit e4a7e0d

Browse files
rvaggtargos
authored andcommittedJun 15, 2018
deps: float ea7abee from openssl / CVE-2018-0732
Pending OpenSSL 1.1.0i release. PR-URL: #21282 Reviewed-By: Shigeki Ohtsu <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Upstream: openssl/openssl@ea7abee Original commit message: Reject excessively large primes in DH key generation. CVE-2018-0732 Signed-off-by: Guido Vranken <[email protected]> (cherry picked from commit 91f7361f47b082ae61ffe1a7b17bb2adf213c7fe) Reviewed-by: Tim Hudson <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from openssl/openssl#6457)
1 parent e1b571d commit e4a7e0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎deps/openssl/openssl/crypto/dh/dh_key.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,15 @@ static int generate_key(DH *dh)
7878
int ok = 0;
7979
int generate_new_key = 0;
8080
unsigned l;
81-
BN_CTX *ctx;
81+
BN_CTX *ctx = NULL;
8282
BN_MONT_CTX *mont = NULL;
8383
BIGNUM *pub_key = NULL, *priv_key = NULL;
8484

85+
if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) {
86+
DHerr(DH_F_GENERATE_KEY, DH_R_MODULUS_TOO_LARGE);
87+
return 0;
88+
}
89+
8590
ctx = BN_CTX_new();
8691
if (ctx == NULL)
8792
goto err;

0 commit comments

Comments
 (0)
Please sign in to comment.