diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2007-05-15 23:52:03 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2007-05-15 23:52:03 +0000 |
commit | e69adea53921cac7a7a012cade24cce228a310a5 (patch) | |
tree | b4720b439776fb071d1d1d2c8b23c5403b27e315 /crypto/evp/m_sigver.c | |
parent | 9660cbcd6b5981f631d10dad6a55008306e5c20b (diff) |
New function EVP_PKEY_asn1_copy(). Use default MD if type param is NULL.
Diffstat (limited to 'crypto/evp/m_sigver.c')
-rw-r--r-- | crypto/evp/m_sigver.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c index 8fdfe61b3f..e12f85f69f 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -71,6 +71,20 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, ctx->pctx = EVP_PKEY_CTX_new(pkey, e); if (ctx->pctx == NULL) return 0; + + if (type == NULL) + { + int def_nid; + if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) > 0) + type = EVP_get_digestbynid(def_nid); + } + + if (type == NULL) + { + EVPerr(EVP_F_DO_SIGVER_INIT, EVP_R_NO_DEFAULT_DIGEST); + return 0; + } + if (ver) { if (ctx->pctx->pmeth->verifyctx_init) |