summaryrefslogtreecommitdiffstats
path: root/crypto/evp/keymgmt_meth.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-09-23 10:56:13 +0200
committerRichard Levitte <levitte@openssl.org>2019-10-17 09:16:45 +0200
commitf651c727f85813085355bb207cf913288108ed79 (patch)
tree0eceb269b851cf095712b5332d4b222beb1c6fb3 /crypto/evp/keymgmt_meth.c
parentEVP: add missing common functionality (diff)
downloadopenssl-f651c727f85813085355bb207cf913288108ed79.tar.xz
openssl-f651c727f85813085355bb207cf913288108ed79.zip
EVP: add name traversal functions to all fetchable types
The following new functions all do the same thing; they traverse the set of names assigned to implementations of each algorithm type: EVP_MD_names_do_all(), EVP_CIPHER_names_do_all(), EVP_MAC_names_do_all(), EVP_KEYMGMT_names_do_all(), EVP_KEYEXCH_names_do_all(), EVP_KDF_names_do_all(), EVP_SIGNATURE_names_do_all() We add a warning to the documentation of EVP_CIPHER_name() and EVP_MD_name(), as they aren't suitable to use with multiple-name implementation. We also remove EVP_MAC_name() and evp_KDF_name(), as they serve no useful purpose. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/9979)
Diffstat (limited to 'crypto/evp/keymgmt_meth.c')
-rw-r--r--crypto/evp/keymgmt_meth.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/evp/keymgmt_meth.c b/crypto/evp/keymgmt_meth.c
index 990f899159..6a1c15ae24 100644
--- a/crypto/evp/keymgmt_meth.c
+++ b/crypto/evp/keymgmt_meth.c
@@ -214,3 +214,11 @@ void EVP_KEYMGMT_do_all_provided(OPENSSL_CTX *libctx,
keymgmt_from_dispatch, NULL,
(void (*)(void *))EVP_KEYMGMT_free);
}
+
+void EVP_KEYMGMT_names_do_all(const EVP_KEYMGMT *keymgmt,
+ void (*fn)(const char *name, void *data),
+ void *data)
+{
+ if (keymgmt->prov != NULL)
+ evp_names_do_all(keymgmt->prov, keymgmt->name_id, fn, data);
+}