diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-30 21:37:06 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-30 21:37:06 -0400 |
commit | 23a1d5e97cd543d2b8e1b01dbf0f619b2e5ce540 (patch) | |
tree | 2d9372864fc2b34939d21b3706768ec225c9548f /engines/ccgost/gost2001.c | |
parent | 34166d41892643a36ad2d1f53cc0025e2edc2a39 (diff) |
free NULL cleanup 7
This gets BN_.*free:
BN_BLINDING_free BN_CTX_free BN_FLG_FREE BN_GENCB_free
BN_MONT_CTX_free BN_RECP_CTX_free BN_clear_free BN_free BUF_MEM_free
Also fix a call to DSA_SIG_free to ccgost engine and remove some #ifdef'd
dead code in engines/e_ubsec.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'engines/ccgost/gost2001.c')
-rw-r--r-- | engines/ccgost/gost2001.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/engines/ccgost/gost2001.c b/engines/ccgost/gost2001.c index 83cc693f75..5490a5d760 100644 --- a/engines/ccgost/gost2001.c +++ b/engines/ccgost/gost2001.c @@ -111,10 +111,9 @@ int fill_GOST2001_params(EC_KEY *eckey, int nid) err: if (P) EC_POINT_free(P); if (grp) EC_GROUP_free(grp); - if (ctx) { + if (ctx) BN_CTX_end(ctx); - BN_CTX_free(ctx); - } + BN_CTX_free(ctx); return ok; } @@ -241,15 +240,13 @@ DSA_SIG *gost2001_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey) ret = newsig; err: - if (ctx) { + if (ctx) BN_CTX_end(ctx); - BN_CTX_free(ctx); - } + BN_CTX_free(ctx); if (C) EC_POINT_free(C); - if (md) BN_free(md); - if (!ret && newsig) { + BN_free(md); + if (!ret) DSA_SIG_free(newsig); - } return ret; } @@ -365,11 +362,10 @@ int gost2001_do_verify(const unsigned char *dgst, int dgst_len, } err: if (C) EC_POINT_free(C); - if (ctx) { + if (ctx) BN_CTX_end(ctx); - BN_CTX_free(ctx); - } - if (md) BN_free(md); + BN_CTX_free(ctx); + BN_free(md); return ok; } @@ -418,10 +414,9 @@ int gost2001_compute_public(EC_KEY *ec) ok = 256; err: if (pub_key) EC_POINT_free(pub_key); - if (ctx) { + if (ctx) BN_CTX_end(ctx); - BN_CTX_free(ctx); - } + BN_CTX_free(ctx); return ok; } |