diff options
Diffstat (limited to 'crypto/provider_child.c')
-rw-r--r-- | crypto/provider_child.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/crypto/provider_child.c b/crypto/provider_child.c index 16728f9c12..b1eadd5b19 100644 --- a/crypto/provider_child.c +++ b/crypto/provider_child.c @@ -16,6 +16,7 @@ #include "internal/provider.h" #include "internal/cryptlib.h" #include "crypto/evp.h" +#include "crypto/context.h" DEFINE_STACK_OF(OSSL_PROVIDER) @@ -33,12 +34,12 @@ struct child_prov_globals { OSSL_FUNC_provider_free_fn *c_prov_free; }; -static void *child_prov_ossl_ctx_new(OSSL_LIB_CTX *libctx) +void *ossl_child_prov_ctx_new(OSSL_LIB_CTX *libctx) { return OPENSSL_zalloc(sizeof(struct child_prov_globals)); } -static void child_prov_ossl_ctx_free(void *vgbl) +void ossl_child_prov_ctx_free(void *vgbl) { struct child_prov_globals *gbl = vgbl; @@ -46,12 +47,6 @@ static void child_prov_ossl_ctx_free(void *vgbl) OPENSSL_free(gbl); } -static const OSSL_LIB_CTX_METHOD child_prov_ossl_ctx_method = { - OSSL_LIB_CTX_METHOD_LOW_PRIORITY, - child_prov_ossl_ctx_new, - child_prov_ossl_ctx_free, -}; - static OSSL_provider_init_fn ossl_child_provider_init; static int ossl_child_provider_init(const OSSL_CORE_HANDLE *handle, @@ -84,8 +79,7 @@ static int ossl_child_provider_init(const OSSL_CORE_HANDLE *handle, */ ctx = (OSSL_LIB_CTX *)c_get_libctx(handle); - gbl = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX, - &child_prov_ossl_ctx_method); + gbl = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX); if (gbl == NULL) return 0; @@ -103,8 +97,7 @@ static int provider_create_child_cb(const OSSL_CORE_HANDLE *prov, void *cbdata) OSSL_PROVIDER *cprov; int ret = 0; - gbl = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX, - &child_prov_ossl_ctx_method); + gbl = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX); if (gbl == NULL) return 0; @@ -166,8 +159,7 @@ static int provider_remove_child_cb(const OSSL_CORE_HANDLE *prov, void *cbdata) const char *provname; OSSL_PROVIDER *cprov; - gbl = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX, - &child_prov_ossl_ctx_method); + gbl = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX); if (gbl == NULL) return 0; @@ -203,8 +195,7 @@ int ossl_provider_init_as_child(OSSL_LIB_CTX *ctx, if (ctx == NULL) return 0; - gbl = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX, - &child_prov_ossl_ctx_method); + gbl = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX); if (gbl == NULL) return 0; @@ -271,8 +262,7 @@ int ossl_provider_init_as_child(OSSL_LIB_CTX *ctx, void ossl_provider_deinit_child(OSSL_LIB_CTX *ctx) { struct child_prov_globals *gbl - = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX, - &child_prov_ossl_ctx_method); + = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_CHILD_PROVIDER_INDEX); if (gbl == NULL) return; @@ -297,8 +287,7 @@ int ossl_provider_up_ref_parent(OSSL_PROVIDER *prov, int activate) const OSSL_CORE_HANDLE *parent_handle; gbl = ossl_lib_ctx_get_data(ossl_provider_libctx(prov), - OSSL_LIB_CTX_CHILD_PROVIDER_INDEX, - &child_prov_ossl_ctx_method); + OSSL_LIB_CTX_CHILD_PROVIDER_INDEX); if (gbl == NULL) return 0; @@ -314,8 +303,7 @@ int ossl_provider_free_parent(OSSL_PROVIDER *prov, int deactivate) const OSSL_CORE_HANDLE *parent_handle; gbl = ossl_lib_ctx_get_data(ossl_provider_libctx(prov), - OSSL_LIB_CTX_CHILD_PROVIDER_INDEX, - &child_prov_ossl_ctx_method); + OSSL_LIB_CTX_CHILD_PROVIDER_INDEX); if (gbl == NULL) return 0; |