diff options
author | Dr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com> | 2020-06-21 01:19:16 +0200 |
---|---|---|
committer | Dr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com> | 2020-06-24 22:01:22 +0200 |
commit | 363b1e5daea4a01889e6ff27148018be63d33b9b (patch) | |
tree | 9e6f5fe3be912b433fa848c44df11a15d0aa2921 /providers | |
parent | 23c48d94d4d34eedc15fa65e0fa0e38a6137e09f (diff) |
Make the naming scheme for dispatched functions more consistent
The new naming scheme consistently usese the `OSSL_FUNC_` prefix for all
functions which are dispatched between the core and providers.
This change includes in particular all up- and downcalls, i.e., the
dispatched functions passed from core to provider and vice versa.
- OSSL_core_ -> OSSL_FUNC_core_
- OSSL_provider_ -> OSSL_FUNC_core_
For operations and their function dispatch tables, the following convention
is used:
Type | Name (evp_generic_fetch(3)) |
---------------------|-----------------------------------|
operation | OSSL_OP_FOO |
function id | OSSL_FUNC_FOO_FUNCTION_NAME |
function "name" | OSSL_FUNC_foo_function_name |
function typedef | OSSL_FUNC_foo_function_name_fn |
function ptr getter | OSSL_FUNC_foo_function_name |
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12222)
Diffstat (limited to 'providers')
101 files changed, 992 insertions, 992 deletions
diff --git a/providers/common/bio_prov.c b/providers/common/bio_prov.c index 2186894b11..c193658c58 100644 --- a/providers/common/bio_prov.c +++ b/providers/common/bio_prov.c @@ -12,12 +12,12 @@ #include "internal/cryptlib.h" #include "prov/bio.h" -static OSSL_BIO_new_file_fn *c_bio_new_file = NULL; -static OSSL_BIO_new_membuf_fn *c_bio_new_membuf = NULL; -static OSSL_BIO_read_ex_fn *c_bio_read_ex = NULL; -static OSSL_BIO_write_ex_fn *c_bio_write_ex = NULL; -static OSSL_BIO_free_fn *c_bio_free = NULL; -static OSSL_BIO_vprintf_fn *c_bio_vprintf = NULL; +static OSSL_FUNC_BIO_new_file_fn *c_bio_new_file = NULL; +static OSSL_FUNC_BIO_new_membuf_fn *c_bio_new_membuf = NULL; +static OSSL_FUNC_BIO_read_ex_fn *c_bio_read_ex = NULL; +static OSSL_FUNC_BIO_write_ex_fn *c_bio_write_ex = NULL; +static OSSL_FUNC_BIO_free_fn *c_bio_free = NULL; +static OSSL_FUNC_BIO_vprintf_fn *c_bio_vprintf = NULL; int ossl_prov_bio_from_dispatch(const OSSL_DISPATCH *fns) { @@ -25,27 +25,27 @@ int ossl_prov_bio_from_dispatch(const OSSL_DISPATCH *fns) switch (fns->function_id) { case OSSL_FUNC_BIO_NEW_FILE: if (c_bio_new_file == NULL) - c_bio_new_file = OSSL_get_BIO_new_file(fns); + c_bio_new_file = OSSL_FUNC_BIO_new_file(fns); break; case OSSL_FUNC_BIO_NEW_MEMBUF: if (c_bio_new_membuf == NULL) - c_bio_new_membuf = OSSL_get_BIO_new_membuf(fns); + c_bio_new_membuf = OSSL_FUNC_BIO_new_membuf(fns); break; case OSSL_FUNC_BIO_READ_EX: if (c_bio_read_ex == NULL) - c_bio_read_ex = OSSL_get_BIO_read_ex(fns); + c_bio_read_ex = OSSL_FUNC_BIO_read_ex(fns); break; case OSSL_FUNC_BIO_WRITE_EX: if (c_bio_write_ex == NULL) - c_bio_write_ex = OSSL_get_BIO_write_ex(fns); + c_bio_write_ex = OSSL_FUNC_BIO_write_ex(fns); break; case OSSL_FUNC_BIO_FREE: if (c_bio_free == NULL) - c_bio_free = OSSL_get_BIO_free(fns); + c_bio_free = OSSL_FUNC_BIO_free(fns); break; case OSSL_FUNC_BIO_VPRINTF: if (c_bio_vprintf == NULL) - c_bio_vprintf = OSSL_get_BIO_vprintf(fns); + c_bio_vprintf = OSSL_FUNC_BIO_vprintf(fns); break; } } diff --git a/providers/common/include/prov/providercommon.h b/providers/common/include/prov/providercommon.h index 2a614f5d81..f39d2e313f 100644 --- a/providers/common/include/prov/providercommon.h +++ b/providers/common/include/prov/providercommon.h @@ -17,4 +17,4 @@ const char *ossl_prov_util_nid_to_name(int nid); int cipher_capable_aes_cbc_hmac_sha1(void); int cipher_capable_aes_cbc_hmac_sha256(void); -OSSL_provider_get_capabilities_fn provider_get_capabilities; +OSSL_FUNC_provider_get_capabilities_fn provider_get_capabilities; diff --git a/providers/defltprov.c b/providers/defltprov.c index 1ea3604377..c92736e547 100644 --- a/providers/defltprov.c +++ b/providers/defltprov.c @@ -25,16 +25,16 @@ * Forward declarations to ensure that interface functions are correctly * defined. */ -static OSSL_provider_gettable_params_fn deflt_gettable_params; -static OSSL_provider_get_params_fn deflt_get_params; -static OSSL_provider_query_operation_fn deflt_query; +static OSSL_FUNC_provider_gettable_params_fn deflt_gettable_params; +static OSSL_FUNC_provider_get_params_fn deflt_get_params; +static OSSL_FUNC_provider_query_operation_fn deflt_query; #define ALGC(NAMES, FUNC, CHECK) { { NAMES, "provider=default", FUNC }, CHECK } #define ALG(NAMES, FUNC) ALGC(NAMES, FUNC, NULL) /* Functions provided by the core */ -static OSSL_core_gettable_params_fn *c_gettable_params = NULL; -static OSSL_core_get_params_fn *c_get_params = NULL; +static OSSL_FUNC_core_gettable_params_fn *c_gettable_params = NULL; +static OSSL_FUNC_core_get_params_fn *c_get_params = NULL; /* Parameters we provide to the core */ static const OSSL_PARAM deflt_param_types[] = { @@ -584,7 +584,7 @@ int ossl_default_provider_init(const OSSL_CORE_HANDLE *handle, const OSSL_DISPATCH **out, void **provctx) { - OSSL_core_get_library_context_fn *c_get_libctx = NULL; + OSSL_FUNC_core_get_library_context_fn *c_get_libctx = NULL; BIO_METHOD *corebiometh; if (!ossl_prov_bio_from_dispatch(in)) @@ -592,13 +592,13 @@ int ossl_default_provider_init(const OSSL_CORE_HANDLE *handle, for (; in->function_id != 0; in++) { switch (in->function_id) { case OSSL_FUNC_CORE_GETTABLE_PARAMS: - c_gettable_params = OSSL_get_core_gettable_params(in); + |