From 32e3c071373280b69be02ba91fc3204495e2e1bf Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 4 May 2022 09:15:29 +0200 Subject: Add method store cache flush and method removal to non-EVP operations evp_method_store_flush() and evp_method_store_remove_all_provided() only cover EVP operations, but not encoders, decoders and store loaders. This adds corresponding methods for those as well. Without this, their method stores are never cleaned up when the corresponding providers are deactivated or otherwise modified. Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/18151) --- crypto/store/store_meth.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crypto/store') diff --git a/crypto/store/store_meth.c b/crypto/store/store_meth.c index 51af5a056e..fc9f1e60e4 100644 --- a/crypto/store/store_meth.c +++ b/crypto/store/store_meth.c @@ -376,6 +376,25 @@ OSSL_STORE_LOADER *ossl_store_loader_fetch_by_number(OSSL_LIB_CTX *libctx, return method; } +int ossl_store_loader_store_cache_flush(OSSL_LIB_CTX *libctx) +{ + OSSL_METHOD_STORE *store = get_loader_store(libctx); + + if (store != NULL) + return ossl_method_store_cache_flush_all(store); + return 1; +} + +int ossl_store_loader_store_remove_all_provided(const OSSL_PROVIDER *prov) +{ + OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov); + OSSL_METHOD_STORE *store = get_loader_store(libctx); + + if (store != NULL) + return ossl_method_store_remove_all_provided(store, prov); + return 1; +} + /* * Library of basic method functions */ -- cgit v1.2.3