summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2022-04-22 16:44:51 +0200
committerRichard Levitte <levitte@openssl.org>2022-05-05 15:05:55 +0200
commit2e4d0677ea858c619a33235265dbee19520a9d35 (patch)
tree9d8df904bc5e2c15919065c7fe0e7f85c88d76a6 /crypto/evp
parent60640d79ca7ea0980dc09c71fe6a297b5f8588a2 (diff)
Make it possible to remove methods by the provider that provides them
This adds ossl_method_store_remove_all_provided(), which selectively removes methods from the given store that are provided by the given provider. This also adds the EVP specific evp_method_store_remove_all_provided(), which matches ossl_method_store_remove_all_provided() but can also retrieve the correct store to manipulate for EVP functions. This allows us to modify ossl_provider_self_test() to do the job it's supposed to do, but through clearly defined functions instead of a cache flushing call that previously did more than that. ossl_provider_deactivate() is also modified to remove methods associated with the deactivated provider, and not just clearing the cache. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18151)
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/evp_fetch.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c
index 5fe9c7e930..e3c43f419e 100644
--- a/crypto/evp/evp_fetch.c
+++ b/crypto/evp/evp_fetch.c
@@ -418,6 +418,16 @@ int evp_method_store_cache_flush(OSSL_LIB_CTX *libctx)
return 1;
}
+int evp_method_store_remove_all_provided(const OSSL_PROVIDER *prov)
+{
+ OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
+ OSSL_METHOD_STORE *store = get_evp_method_store(libctx);
+
+ if (store != NULL)
+ return ossl_method_store_remove_all_provided(store, prov);
+ return 1;
+}
+
static int evp_set_parsed_default_properties(OSSL_LIB_CTX *libctx,
OSSL_PROPERTY_LIST *def_prop,
int loadconfig,