summaryrefslogtreecommitdiffstats
path: root/crypto/dsa/dsa_depr.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2014-10-28 22:56:18 +0000
committerMatt Caswell <matt@openssl.org>2014-12-08 21:40:41 +0000
commitc0d439019460def565bb115ecef749833eb4c299 (patch)
tree21f17f74c59d2da829b7a07f257ae6e7729cec1c /crypto/dsa/dsa_depr.c
parent829ccf6ab6aab03a3f60f644027b43a5d2035bf8 (diff)
Implement internally opaque bn access from dsa
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/dsa/dsa_depr.c')
-rw-r--r--crypto/dsa/dsa_depr.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/crypto/dsa/dsa_depr.c b/crypto/dsa/dsa_depr.c
index f2da680eb4..35c3423f29 100644
--- a/crypto/dsa/dsa_depr.c
+++ b/crypto/dsa/dsa_depr.c
@@ -89,16 +89,26 @@ DSA *DSA_generate_parameters(int bits,
void (*callback)(int, int, void *),
void *cb_arg)
{
- BN_GENCB cb;
+ BN_GENCB *cb;
DSA *ret;
if ((ret=DSA_new()) == NULL) return NULL;
+ cb = BN_GENCB_new();
+ if(!cb)
+ {
+ DSA_free(ret);
+ return NULL;
+ }
- BN_GENCB_set_old(&cb, callback, cb_arg);
+ BN_GENCB_set_old(cb, callback, cb_arg);
if(DSA_generate_parameters_ex(ret, bits, seed_in, seed_len,
- counter_ret, h_ret, &cb))
+ counter_ret, h_ret, cb))
+ {
+ BN_GENCB_free(cb);
return ret;
+ }
+ BN_GENCB_free(cb);
DSA_free(ret);
return NULL;
}