summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-04-20 09:14:59 +0200
committerMatt Caswell <matt@openssl.org>2020-04-23 10:44:37 +0100
commit3b924da0f0e88edf60c561703ea40f63e418c45d (patch)
treede0706f1e710a759741d3b7d9c347e8c2ccc0aaa /include
parent916b1f83d094fe2e0f7dea1e24f4eac3287a4157 (diff)
EVP: add internal evp_keymgmt_util_get_deflt_digest_name() and use it
evp_keymgmt_util_get_deflt_digest_name() is a refactor of the provider side key part of EVP_PKEY_get_default_digest_name(), that takes EVP_KEYMGMT and provider keydata pointers instead of an EVP_PKEY pointer. We also ensure that it uses SN_undef as the default name if the provider implementation gave us an empty string, since this is what EVP_PKEY_get_default_digest_name() responds when getting the digest name via a EVP_PKEY_ASN1_METHOD ctrl call that returns NID_undef. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11576)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/evp.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/crypto/evp.h b/include/crypto/evp.h
index 3f9cc9c683..7179d2adec 100644
--- a/include/crypto/evp.h
+++ b/include/crypto/evp.h
@@ -655,7 +655,9 @@ int evp_keymgmt_util_match(EVP_PKEY *pk1, EVP_PKEY *pk2, int selection);
int evp_keymgmt_util_copy(EVP_PKEY *to, EVP_PKEY *from, int selection);
void *evp_keymgmt_util_gen(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
void *genctx, OSSL_CALLBACK *cb, void *cbarg);
-
+int evp_keymgmt_util_get_deflt_digest_name(EVP_KEYMGMT *keymgmt,
+ void *keydata,
+ char *mdname, size_t mdname_sz);
/*
* KEYMGMT provider interface functions