summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-07-13 07:02:54 +0200
committerRichard Levitte <levitte@openssl.org>2019-07-23 06:34:09 +0200
commitc540f00f383754fa490be76c2c3398ccd4d2a869 (patch)
tree4e8e7fe4d196668f7cf7030d7bd77d315ced8054 /crypto
parent3d96a51c09296cb5c283efb5681105a7691e6fbc (diff)
Add EVP_CIPHER_do_all_ex() and EVP_MD_do_all_ex()
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9356)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/digest.c9
-rw-r--r--crypto/evp/evp_enc.c9
2 files changed, 18 insertions, 0 deletions
diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index 27f9d128ee..78e8756f2a 100644
--- a/crypto/evp/digest.c
+++ b/crypto/evp/digest.c
@@ -701,3 +701,12 @@ EVP_MD *EVP_MD_fetch(OPENSSL_CTX *ctx, const char *algorithm,
return md;
}
+
+void EVP_MD_do_all_ex(OPENSSL_CTX *libctx,
+ void (*fn)(EVP_MD *mac, void *arg),
+ void *arg)
+{
+ evp_generic_do_all(libctx, OSSL_OP_DIGEST,
+ (void (*)(void *, void *))fn, arg,
+ evp_md_from_dispatch, evp_md_free);
+}
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index bfdd581e0d..0873bae81a 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -1263,3 +1263,12 @@ EVP_CIPHER *EVP_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
return cipher;
}
+
+void EVP_CIPHER_do_all_ex(OPENSSL_CTX *libctx,
+ void (*fn)(EVP_CIPHER *mac, void *arg),
+ void *arg)
+{
+ evp_generic_do_all(libctx, OSSL_OP_CIPHER,
+ (void (*)(void *, void *))fn, arg,
+ evp_cipher_from_dispatch, evp_cipher_free);
+}