From 447588b69aa6ba46e61302570df9d2d2a57960ed Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 7 May 2021 17:59:47 +0100 Subject: Add a callback for providers to know about global properties changes Where a child libctx is in use it needs to know what the current global properties are. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15242) --- crypto/provider_child.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crypto/provider_child.c') diff --git a/crypto/provider_child.c b/crypto/provider_child.c index 14d0054624..e4d586bf7d 100644 --- a/crypto/provider_child.c +++ b/crypto/provider_child.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "internal/provider.h" #include "internal/cryptlib.h" @@ -198,6 +199,13 @@ static int provider_remove_child_cb(const OSSL_CORE_HANDLE *prov, void *cbdata) return 1; } +static int provider_global_props_cb(const char *props, void *cbdata) +{ + OSSL_LIB_CTX *ctx = cbdata; + + return evp_set_default_properties_int(ctx, props, 0, 1); +} + int ossl_provider_init_as_child(OSSL_LIB_CTX *ctx, const OSSL_CORE_HANDLE *handle, const OSSL_DISPATCH *in) @@ -265,6 +273,7 @@ int ossl_provider_init_as_child(OSSL_LIB_CTX *ctx, if (!gbl->c_provider_register_child_cb(gbl->handle, provider_create_child_cb, provider_remove_child_cb, + provider_global_props_cb, ctx)) return 0; -- cgit v1.2.3