summaryrefslogtreecommitdiffstats
path: root/crypto/provider_child.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-05-07 17:59:47 +0100
committerMatt Caswell <matt@openssl.org>2021-05-20 09:32:40 +0100
commit447588b69aa6ba46e61302570df9d2d2a57960ed (patch)
treec0bd727c9b2b0c43ed023bba922ffb8a30684ee8 /crypto/provider_child.c
parentad8570a8b6b4ec27e92013653d4d36b0c1b36991 (diff)
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 <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15242)
Diffstat (limited to 'crypto/provider_child.c')
-rw-r--r--crypto/provider_child.c9
1 files changed, 9 insertions, 0 deletions
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 <openssl/core_dispatch.h>
#include <openssl/core_names.h>
#include <openssl/provider.h>
+#include <openssl/evp.h>
#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;