Block DH key gen for small key sizes too.
This commit is contained in:
parent
7016b1952e
commit
0fd9322af1
@ -112,6 +112,12 @@ static int generate_key(DH *dh)
|
|||||||
BN_MONT_CTX *mont=NULL;
|
BN_MONT_CTX *mont=NULL;
|
||||||
BIGNUM *pub_key=NULL,*priv_key=NULL;
|
BIGNUM *pub_key=NULL,*priv_key=NULL;
|
||||||
|
|
||||||
|
if (FIPS_mode() && (BN_num_bits(dh->p) < OPENSSL_DH_FIPS_MIN_MODULUS_BITS))
|
||||||
|
{
|
||||||
|
DHerr(DH_F_GENERATE_KEY, DH_R_KEY_SIZE_TOO_SMALL);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
ctx = BN_CTX_new();
|
ctx = BN_CTX_new();
|
||||||
if (ctx == NULL) goto err;
|
if (ctx == NULL) goto err;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user