projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactor OSSL_LIB_CTX to avoid using CRYPTO_EX_DATA
[openssl.git]
/
crypto
/
initthread.c
diff --git
a/crypto/initthread.c
b/crypto/initthread.c
index 1bdaeda9fc8ed60d0773421eceb70faa97a9f07b..ee57d144662889559a5ddc7127e0d200b515d1a6 100644
(file)
--- 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/cryptlib.h"
#include "prov/providercommon.h"
#include "internal/thread_once.h"
+#include "crypto/context.h"
#ifdef FIPS_MODULE
#include "prov/provider_ctx.h"
#ifdef FIPS_MODULE
#include "prov/provider_ctx.h"
@@
-248,7
+249,7
@@
void ossl_ctx_thread_stop(OSSL_LIB_CTX *ctx)
#else
#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));
{
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;
}
return NULL;
}
-
static void thread_event_ossl
_ctx_free(void *tlocal)
+
void ossl_thread_event
_ctx_free(void *tlocal)
{
OPENSSL_free(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);
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
{
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;
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 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
#else
/*
* Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per