X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=crypto%2Finitthread.c;h=ee57d144662889559a5ddc7127e0d200b515d1a6;hb=927d0566ded0dff9d6c5abc8a40bb84068446b76;hp=1bdaeda9fc8ed60d0773421eceb70faa97a9f07b;hpb=9c140a33663f319ad4000a6a985c3e14297c7389;p=openssl.git diff --git a/crypto/initthread.c b/crypto/initthread.c index 1bdaeda9fc..ee57d14466 100644 --- a/crypto/initthread.c +++ b/crypto/initthread.c @@ -12,6 +12,7 @@ #include "crypto/cryptlib.h" #include "prov/providercommon.h" #include "internal/thread_once.h" +#include "crypto/context.h" #ifdef FIPS_MODULE #include "prov/provider_ctx.h" @@ -248,7 +249,7 @@ void ossl_ctx_thread_stop(OSSL_LIB_CTX *ctx) #else -static void *thread_event_ossl_ctx_new(OSSL_LIB_CTX *libctx) +void *ossl_thread_event_ctx_new(OSSL_LIB_CTX *libctx) { THREAD_EVENT_HANDLER **hands = NULL; CRYPTO_THREAD_LOCAL *tlocal = OPENSSL_zalloc(sizeof(*tlocal)); @@ -274,17 +275,11 @@ static void *thread_event_ossl_ctx_new(OSSL_LIB_CTX *libctx) return NULL; } -static void thread_event_ossl_ctx_free(void *tlocal) +void ossl_thread_event_ctx_free(void *tlocal) { OPENSSL_free(tlocal); } -static const OSSL_LIB_CTX_METHOD thread_event_ossl_ctx_method = { - OSSL_LIB_CTX_METHOD_DEFAULT_PRIORITY, - thread_event_ossl_ctx_new, - thread_event_ossl_ctx_free, -}; - static void ossl_arg_thread_stop(void *arg) { ossl_ctx_thread_stop((OSSL_LIB_CTX *)arg); @@ -294,8 +289,7 @@ void ossl_ctx_thread_stop(OSSL_LIB_CTX *ctx) { THREAD_EVENT_HANDLER **hands; CRYPTO_THREAD_LOCAL *local - = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX, - &thread_event_ossl_ctx_method); + = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX); if (local == NULL) return; @@ -363,8 +357,7 @@ int ossl_init_thread_start(const void *index, void *arg, * OSSL_LIB_CTX gets informed about thread stop events individually. */ CRYPTO_THREAD_LOCAL *local - = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX, - &thread_event_ossl_ctx_method); + = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX); #else /* * Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per