Skip to content

Commit bb82a62

Browse files
committed
deps: float 3984ef0 from openssl / CVE-2018-0732
Pending OpenSSL 1.0.2p release. Ref: nodejs#21282 Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Upstream: openssl/openssl@3984ef0 Original commit message: Reject excessively large primes in DH key generation. CVE-2018-0732 Signed-off-by: Guido Vranken <guidovranken@gmail.com> (cherry picked from commit 91f7361) Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from nodejs#6457)
1 parent a5d1ab3 commit bb82a62

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
@@ -130,10 +130,15 @@ static int generate_key(DH *dh)
130130
int ok = 0;
131131
int generate_new_key = 0;
132132
unsigned l;
133-
BN_CTX *ctx;
133+
BN_CTX *ctx = NULL;
134134
BN_MONT_CTX *mont = NULL;
135135
BIGNUM *pub_key = NULL, *priv_key = NULL;
136136

137+
if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) {
138+
DHerr(DH_F_GENERATE_KEY, DH_R_MODULUS_TOO_LARGE);
139+
return 0;
140+
}
141+
137142
ctx = BN_CTX_new();
138143
if (ctx == NULL)
139144
goto err;

0 commit comments

Comments
 (0)