diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-10-11 23:28:54 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-10-11 23:28:54 +0000 |
commit | 05bbbe920422c3789c37f37231fb12832841f64f (patch) | |
tree | cf3c0b3301d77c06788f6257981e27cfeb9dbbf7 /crypto/dsa | |
parent | a073129293fd1cc0dbb1325d36fa85eb3190feb0 (diff) |
PR: 2295
Submitted by: Alexei Khlebnikov <alexei.khlebnikov@opera.com>
Reviewed by: steve
OOM checking. Leak in OOM fix. Fall-through comment. Duplicate code
elimination.
Diffstat (limited to 'crypto/dsa')
-rw-r--r-- | crypto/dsa/dsa_ossl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c index 412cf1d88b..1727760806 100644 --- a/crypto/dsa/dsa_ossl.c +++ b/crypto/dsa/dsa_ossl.c @@ -178,7 +178,8 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */ if (!BN_add(s, &xr, &m)) goto err; /* s = m + xr */ if (BN_cmp(s,dsa->q) > 0) - BN_sub(s,s,dsa->q); + if (!BN_sub(s,s,dsa->q)) + goto err; if (!BN_mod_mul(s,s,kinv,dsa->q,ctx)) goto err; ret=DSA_SIG_new(); |