diff options
author | Matt Caswell <matt@openssl.org> | 2021-04-23 12:08:27 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-05-11 14:59:43 +0100 |
commit | 7b88c184b66c0d7cfb1f76422448af6a636eea8c (patch) | |
tree | 3c35397ba7aef0a28e0d6e0eba5d5808733021ce /include | |
parent | 5442611dffed2c345ef83d494f2ef7ffb9cf3883 (diff) |
Register callbacks with core for child provider creation/deletion
By adding callbacks to the core this will enable (in future commits) the
ability to add/remove child providers as the providers are added/removed
from the parent libctx.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14991)
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/core.h | 1 | ||||
-rw-r--r-- | include/openssl/core_dispatch.h | 34 |
2 files changed, 19 insertions, 16 deletions
diff --git a/include/openssl/core.h b/include/openssl/core.h index 71e860f99d..3356ef2088 100644 --- a/include/openssl/core.h +++ b/include/openssl/core.h @@ -30,7 +30,6 @@ extern "C" { typedef struct ossl_core_handle_st OSSL_CORE_HANDLE; typedef struct openssl_core_ctx_st OPENSSL_CORE_CTX; typedef struct ossl_core_bio_st OSSL_CORE_BIO; -typedef struct ossl_core_provider_st OSSL_CORE_PROVIDER; /* * Dispatch table element. function_id numbers and the functions are defined diff --git a/include/openssl/core_dispatch.h b/include/openssl/core_dispatch.h index 6b5e2e2935..c2c6c45976 100644 --- a/include/openssl/core_dispatch.h +++ b/include/openssl/core_dispatch.h @@ -184,21 +184,25 @@ OSSL_CORE_MAKE_FUNC(void, cleanup_nonce, (const OSSL_CORE_HANDLE *handle, unsigned char *buf, size_t len)) /* Functions to access the core's providers */ -#define OSSL_FUNC_CORE_PROVIDER_DO_ALL 105 -#define OSSL_FUNC_CORE_PROVIDER_NAME 106 -#define OSSL_FUNC_CORE_PROVIDER_GET0_PROVIDER_CTX 107 -#define OSSL_FUNC_CORE_PROVIDER_GET0_DISPATCH 108 - -OSSL_CORE_MAKE_FUNC(int, core_provider_do_all, (const OPENSSL_CORE_CTX *ctx, - int (*cb)(OSSL_CORE_PROVIDER *provider, - void *cbdata), - void *cbdata)) -OSSL_CORE_MAKE_FUNC(const char *, core_provider_name, - (const OSSL_CORE_PROVIDER *prov)) -OSSL_CORE_MAKE_FUNC(void *, core_provider_get0_provider_ctx, - (const OSSL_CORE_PROVIDER *prov)) -OSSL_CORE_MAKE_FUNC(const OSSL_DISPATCH *, core_provider_get0_dispatch, - (const OSSL_CORE_PROVIDER *prov)) +#define OSSL_FUNC_PROVIDER_REGISTER_CHILD_CB 105 +#define OSSL_FUNC_PROVIDER_DEREGISTER_CHILD_CB 106 +#define OSSL_FUNC_PROVIDER_NAME 107 +#define OSSL_FUNC_PROVIDER_GET0_PROVIDER_CTX 108 +#define OSSL_FUNC_PROVIDER_GET0_DISPATCH 109 + +OSSL_CORE_MAKE_FUNC(int, provider_register_child_cb, + (const OSSL_CORE_HANDLE *handle, + int (*create_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata), + int (*remove_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata), + void *cbdata)) +OSSL_CORE_MAKE_FUNC(void, provider_deregister_child_cb, + (const OSSL_CORE_HANDLE *handle)) +OSSL_CORE_MAKE_FUNC(const char *, provider_name, + (const OSSL_CORE_HANDLE *prov)) +OSSL_CORE_MAKE_FUNC(void *, provider_get0_provider_ctx, + (const OSSL_CORE_HANDLE *prov)) +OSSL_CORE_MAKE_FUNC(const OSSL_DISPATCH *, provider_get0_dispatch, + (const OSSL_CORE_HANDLE *prov)) /* Functions provided by the provider to the Core, reserved numbers 1024-1535 */ # define OSSL_FUNC_PROVIDER_TEARDOWN 1024 |