Block DH key gen for small key sizes too.

This commit is contained in:
Dr. Stephen Henson 2007-08-18 02:46:11 +00:00
parent 7016b1952e
commit 0fd9322af1

View File

@ -112,6 +112,12 @@ static int generate_key(DH *dh)
BN_MONT_CTX *mont=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();
if (ctx == NULL) goto err;