summaryrefslogtreecommitdiffstats
path: root/crypto/evp/m_sigver.c
diff options
context:
space:
mode:
authorPaul Yang <yang.yang@baishancloud.com>2018-09-03 18:51:04 +0200
committerPaul Yang <yang.yang@baishancloud.com>2018-09-07 12:12:26 +0200
commit0a8fdef7523ae796ca2e734c279791737148c001 (patch)
treeb8373ba17b5d293a7e9c81743e33f8a763a97c53 /crypto/evp/m_sigver.c
parentIntroduce EVP_MD_CTX_set_pkey_ctx (diff)
downloadopenssl-0a8fdef7523ae796ca2e734c279791737148c001.tar.xz
openssl-0a8fdef7523ae796ca2e734c279791737148c001.zip
Support pmeth->digest_custom
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7113)
Diffstat (limited to 'crypto/evp/m_sigver.c')
-rw-r--r--crypto/evp/m_sigver.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c
index 2377944f66..4a0e5d5c55 100644
--- a/crypto/evp/m_sigver.c
+++ b/crypto/evp/m_sigver.c
@@ -75,6 +75,14 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
return 1;
if (!EVP_DigestInit_ex(ctx, type, e))
return 0;
+ if (ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_DIGEST_CUSTOM) {
+ /*
+ * This indicates the current algorithm requires
+ * special treatment before hashing the tbs-message.
+ */
+ if (ctx->pctx->pmeth->digest_custom)
+ return ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx);
+ }
return 1;
}