◐ Shell
clean mode source ↗

deps: float ea7abee from openssl / CVE-2018-0732 · nodejs/node@e4a7e0d

File tree

  • deps/openssl/openssl/crypto/dh

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;