summaryrefslogtreecommitdiffstats
path: root/crypto/store
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2022-05-04 09:15:29 +0200
committerRichard Levitte <levitte@openssl.org>2022-05-05 15:06:12 +0200
commit32e3c071373280b69be02ba91fc3204495e2e1bf (patch)
tree2d2c6b36aec2a7bb3073cd1de29e72a9b78490ab /crypto/store
parentFor child libctx / provider, don't count self-references in parent (diff)
downloadopenssl-32e3c071373280b69be02ba91fc3204495e2e1bf.tar.xz
openssl-32e3c071373280b69be02ba91fc3204495e2e1bf.zip
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 <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18151)
Diffstat (limited to 'crypto/store')
-rw-r--r--crypto/store/store_meth.c19
1 files changed, 19 insertions, 0 deletions
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
*/