summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-03-14 08:13:12 +0000
committerPauli <pauli@openssl.org>2022-04-01 10:49:19 +1100
commit927d0566ded0dff9d6c5abc8a40bb84068446b76 (patch)
treec6d898a04aaa2062c9a74cb9c89ce25fa9680a41 /crypto/evp
parent9c140a33663f319ad4000a6a985c3e14297c7389 (diff)
Refactor OSSL_LIB_CTX to avoid using CRYPTO_EX_DATA
This refactors OSSL_LIB_CTX to avoid using CRYPTO_EX_DATA. The assorted objects to be managed by OSSL_LIB_CTX are hardcoded and are initialized eagerly rather than lazily, which avoids the need for locking on access in most cases. Fixes #17116. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17881)
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/evp_fetch.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c
index 3066e0b0d4..06839777f0 100644
--- a/crypto/evp/evp_fetch.c
+++ b/crypto/evp/evp_fetch.c
@@ -23,24 +23,6 @@
#define NAME_SEPARATOR ':'
-static void evp_method_store_free(void *vstore)
-{
- ossl_method_store_free(vstore);
-}
-
-static void *evp_method_store_new(OSSL_LIB_CTX *ctx)
-{
- return ossl_method_store_new(ctx);
-}
-
-
-static const OSSL_LIB_CTX_METHOD evp_method_store_method = {
- /* We want evp_method_store to be cleaned up before the provider store */
- OSSL_LIB_CTX_METHOD_PRIORITY_2,
- evp_method_store_new,
- evp_method_store_free,
-};
-
/* Data to be passed through ossl_method_construct() */
struct evp_method_data_st {
OSSL_LIB_CTX *libctx;
@@ -79,8 +61,7 @@ static void *get_tmp_evp_method_store(void *data)
static OSSL_METHOD_STORE *get_evp_method_store(OSSL_LIB_CTX *libctx)
{
- return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX,
- &evp_method_store_method);
+ return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
}
/*