mirror of
https://github.com/openssl/openssl.git
synced 2024-12-09 05:51:54 +08:00
Check return from BN_set_word.
In ssl/t1_lib.c. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6613)
This commit is contained in:
parent
10c3c1c1ec
commit
8eab767a71
@ -2309,13 +2309,16 @@ DH *ssl_get_auto_dh(SSL *s)
|
|||||||
if (dhp == NULL)
|
if (dhp == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
g = BN_new();
|
g = BN_new();
|
||||||
if (g != NULL)
|
if (g == NULL || !BN_set_word(g, 2)) {
|
||||||
BN_set_word(g, 2);
|
DH_free(dhp);
|
||||||
|
BN_free(g);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (dh_secbits >= 192)
|
if (dh_secbits >= 192)
|
||||||
p = BN_get_rfc3526_prime_8192(NULL);
|
p = BN_get_rfc3526_prime_8192(NULL);
|
||||||
else
|
else
|
||||||
p = BN_get_rfc3526_prime_3072(NULL);
|
p = BN_get_rfc3526_prime_3072(NULL);
|
||||||
if (p == NULL || g == NULL || !DH_set0_pqg(dhp, p, NULL, g)) {
|
if (p == NULL || !DH_set0_pqg(dhp, p, NULL, g)) {
|
||||||
DH_free(dhp);
|
DH_free(dhp);
|
||||||
BN_free(p);
|
BN_free(p);
|
||||||
BN_free(g);
|
BN_free(g);
|
||||||
|
Loading…
Reference in New Issue
Block a user