diff options
author | Richard Levitte <levitte@openssl.org> | 2019-04-30 14:41:51 +0300 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-04-30 16:34:23 +0300 |
commit | a39eb84006ca68d38d1c7204a6135647d06b5d01 (patch) | |
tree | a39170c4d6ece3fc94ae7fc4e09a97d4b090f00f /include/internal | |
parent | f79858ac4d90a450d0620d1ecb713bc35d7d9f8d (diff) |
Replumbing: give the possibility for the provider to create a context
OSSL_provider_init() gets another output parameter, holding a pointer
to a provider side context. It's entirely up to the provider to
define the context and what it's being used for. This pointer is
passed back to other provider functions, typically the provider global
get_params and set_params functions, and also the diverse algorithm
context creators, and of course, the teardown function.
With this, a provider can be instantiated more than once, or be
re-loaded as the case may be, while maintaining instance state.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8848)
Diffstat (limited to 'include/internal')
-rw-r--r-- | include/internal/provider.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/internal/provider.h b/include/internal/provider.h index 4966cc2595..7b0531345d 100644 --- a/include/internal/provider.h +++ b/include/internal/provider.h @@ -45,6 +45,9 @@ int ossl_provider_add_parameter(OSSL_PROVIDER *prov, const char *name, */ int ossl_provider_activate(OSSL_PROVIDER *prov); +/* Return pointer to the provider's context */ +void *ossl_provider_ctx(const OSSL_PROVIDER *prov); + /* Iterate over all loaded providers */ int ossl_provider_forall_loaded(OPENSSL_CTX *, int (*cb)(OSSL_PROVIDER *provider, |