From e3e31ff4824f7d8cdc94127f5988a8e84914822a Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 8 Feb 2010 16:31:28 +0000 Subject: [PATCH] Use supplied ENGINE when initialising CMAC. Restore pctx setting. --- crypto/cmac/cm_pmeth.c | 2 +- crypto/evp/m_sigver.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/cmac/cm_pmeth.c b/crypto/cmac/cm_pmeth.c index 585fc8e4bb..c581e789f7 100644 --- a/crypto/cmac/cm_pmeth.c +++ b/crypto/cmac/cm_pmeth.c @@ -138,7 +138,7 @@ static int pkey_cmac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) break; case EVP_PKEY_CTRL_CIPHER: - if (!CMAC_Init(cmctx, NULL, 0, p2, NULL)) + if (!CMAC_Init(cmctx, NULL, 0, p2, ctx->engine)) return 0; break; diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c index 2fd35a90e4..c7b7390b5e 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -113,6 +113,8 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, } if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type) <= 0) return 0; + if (pctx) + *pctx = ctx->pctx; if (ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM) return 1; if (!EVP_DigestInit_ex(ctx, type, e)) -- 2.39.2