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:14:37 +0200
commit215708c53bc3d62fd29ec842d80fa929910178ee (patch)
treebd09d7354ca07ebec19cfd0e3ae3cbdf1391adeb /crypto/evp
parent8b76db9e2618225f78c84ed2b338cd005f6ef310 (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) (cherry picked from commit 2e4d0677ea858c619a33235265dbee19520a9d35)
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 fd2b38c100..90d6a4e6d4 100644
--- a/crypto/evp/evp_fetch.c
+++ b/crypto/evp/evp_fetch.c
@@ -438,6 +438,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,