diff options
author | Matt Caswell <matt@openssl.org> | 2020-03-16 16:04:12 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-03-23 11:09:49 +0000 |
commit | 55ca81259a63286a88dd1f53ef14f7830f444c7e (patch) | |
tree | 691c5a2ccdadaf0c34594040706ffb86cd7c362b /crypto/evp/m_sigver.c | |
parent | a45694a3567ce8de754cffa7b450c22578ebdd6c (diff) |
Handle mdname in legacy EVP_DigestSignInit_ex codepaths
Even though an application callS the new EVP_DigestSignInit_ex()
function to pass an mdname by string rather than EVP_MD, we may still end
up in legacy codepaths, and therefore we need to handle either mdname or
EVP_MD, in both legacy and non-legacy codepaths.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11353)
Diffstat (limited to 'crypto/evp/m_sigver.c')
-rw-r--r-- | crypto/evp/m_sigver.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c index 3d15a9fcbc..8dd4207d17 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -200,6 +200,9 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, */ ERR_pop_to_mark(); + if (type == NULL && mdname != NULL) + type = evp_get_digestbyname_ex(locpctx->libctx, mdname); + if (ctx->pctx->pmeth == NULL) { EVPerr(0, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); return 0; |