diff options
author | Bodo Möller <bodo@openssl.org> | 2010-02-23 10:36:30 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2010-02-23 10:36:30 +0000 |
commit | 7fe747d1ebd76151dc8b066fce103a487bedd17a (patch) | |
tree | 3f0332bee73e16a2635cc45533ba164011824087 /engines | |
parent | 32567c9f3be1ba5c47079da5e881ded20fa7a078 (diff) |
Always check bn_wexpend() return values for failure (CVE-2009-3245).
(The CHANGES entry covers the change from PR #2111 as well, submitted by
Martin Olsson.)
Submitted by: Neel Mehta
Diffstat (limited to 'engines')
-rw-r--r-- | engines/e_ubsec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/e_ubsec.c b/engines/e_ubsec.c index fe6bdba25b..b685410836 100644 --- a/engines/e_ubsec.c +++ b/engines/e_ubsec.c @@ -935,7 +935,7 @@ static int ubsec_dh_generate_key(DH *dh) priv_key = BN_new(); if (priv_key == NULL) goto err; priv_key_len = BN_num_bits(dh->p); - bn_wexpand(priv_key, dh->p->top); + if(bn_wexpand(priv_key, dh->p->top) == NULL) goto err; do if (!BN_rand_range(priv_key, dh->p)) goto err; while (BN_is_zero(priv_key)); @@ -950,7 +950,7 @@ static int ubsec_dh_generate_key(DH *dh) { pub_key = BN_new(); pub_key_len = BN_num_bits(dh->p); - bn_wexpand(pub_key, dh->p->top); + if(bn_wexpand(pub_key, dh->p->top) == NULL) goto err; if(pub_key == NULL) goto err; } else |