From c0d439019460def565bb115ecef749833eb4c299 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 28 Oct 2014 22:56:18 +0000 Subject: Implement internally opaque bn access from dsa Reviewed-by: Tim Hudson --- crypto/dsa/dsa_pmeth.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crypto/dsa/dsa_pmeth.c') 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 -- cgit v1.2.3