diff options
author | Matt Caswell <matt@openssl.org> | 2014-10-28 22:56:18 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2014-12-08 21:40:41 +0000 |
commit | c0d439019460def565bb115ecef749833eb4c299 (patch) | |
tree | 21f17f74c59d2da829b7a07f257ae6e7729cec1c /crypto/dsa/dsa_pmeth.c | |
parent | 829ccf6ab6aab03a3f60f644027b43a5d2035bf8 (diff) |
Implement internally opaque bn access from dsa
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/dsa/dsa_pmeth.c')
-rw-r--r-- | crypto/dsa/dsa_pmeth.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/dsa/dsa_pmeth.c b/crypto/dsa/dsa_pmeth.c index 4c7a5a847b..2f0586a541 100644 --- a/crypto/dsa/dsa_pmeth.c +++ b/crypto/dsa/dsa_pmeth.c @@ -246,20 +246,25 @@ static int pkey_dsa_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { DSA *dsa = NULL; DSA_PKEY_CTX *dctx = ctx->data; - BN_GENCB *pcb, cb; + BN_GENCB *pcb; int ret; if (ctx->pkey_gencb) { - pcb = &cb; + pcb = BN_GENCB_new(); + if(!pcb) return 0; evp_pkey_set_cb_translate(pcb, ctx); } else pcb = NULL; dsa = DSA_new(); if (!dsa) + { + if(pcb) BN_GENCB_free(pcb); return 0; + } ret = dsa_builtin_paramgen(dsa, dctx->nbits, dctx->qbits, dctx->pmd, NULL, 0, NULL, NULL, NULL, pcb); + if(pcb) BN_GENCB_free(pcb); if (ret) EVP_PKEY_assign_DSA(pkey, dsa); else |