diff options
author | Richard Levitte <levitte@openssl.org> | 2019-08-16 09:04:29 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-08-16 09:04:29 +0200 |
commit | 92d9d0ae2b10b12e42d33047b60e64ebfc296596 (patch) | |
tree | 36268ad8d147f30bb179cb089449beb39271b8d3 | |
parent | 356461fbbb8f4070f57ac4d13b34e0e0bbfee92b (diff) |
Rename ctx_{get,set}_params to {get,set}_ctx_params
Recently, we added dispatched functions to get parameter descriptions,
and those for operation context parameters ended up being called
something_gettable_ctx_params and something_settable_ctx_params.
The corresponding dispatched functions to actually perform parameter
transfers were previously called something_ctx_get_params and
something_ctx_set_params, which doesn't quite match, so we rename them
to something_get_ctx_params and something_set_ctx_params.
An argument in favor of this name change is English, where you'd
rather say something like "set the context parameters".
This only change the libcrypto <-> provider interface.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9612)
26 files changed, 158 insertions, 158 deletions
diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt index 988e6117ec..49e3120ce9 100644 --- a/crypto/err/openssl.txt +++ b/crypto/err/openssl.txt @@ -1150,8 +1150,8 @@ PROV_F_AESNI_INIT_KEY:101:aesni_init_key PROV_F_AES_BLOCK_FINAL:102:aes_block_final PROV_F_AES_BLOCK_UPDATE:103:aes_block_update PROV_F_AES_CIPHER:104:aes_cipher -PROV_F_AES_CTX_GET_PARAMS:105:aes_ctx_get_params -PROV_F_AES_CTX_SET_PARAMS:106:aes_ctx_set_params +PROV_F_AES_GET_CTX_PARAMS:105:aes_get_ctx_params +PROV_F_AES_SET_CTX_PARAMS:106:aes_set_ctx_params PROV_F_AES_DINIT:107:aes_dinit PROV_F_AES_DUPCTX:108:aes_dupctx PROV_F_AES_EINIT:109:aes_einit diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c index 46d5c17e2f..b829b814dd 100644 --- a/crypto/evp/digest.c +++ b/crypto/evp/digest.c @@ -540,8 +540,8 @@ const OSSL_PARAM *EVP_MD_gettable_params(const EVP_MD *digest) int EVP_MD_CTX_set_params(EVP_MD_CTX *ctx, const OSSL_PARAM params[]) { - if (ctx->digest != NULL && ctx->digest->ctx_set_params != NULL) - return ctx->digest->ctx_set_params(ctx->provctx, params); + if (ctx->digest != NULL && ctx->digest->set_ctx_params != NULL) + return ctx->digest->set_ctx_params(ctx->provctx, params); return 0; } @@ -555,7 +555,7 @@ const OSSL_PARAM *EVP_MD_CTX_settable_params(const EVP_MD *digest) int EVP_MD_CTX_get_params(EVP_MD_CTX *ctx, OSSL_PARAM params[]) { if (ctx->digest != NULL && ctx->digest->get_params != NULL) - return ctx->digest->ctx_get_params(ctx->provctx, params); + return ctx->digest->get_ctx_params(ctx->provctx, params); return 0; } @@ -675,13 +675,13 @@ static void *evp_md_from_dispatch(const char *name, const OSSL_DISPATCH *fns, if (md->get_params == NULL) md->get_params = OSSL_get_OP_digest_get_params(fns); break; - case OSSL_FUNC_DIGEST_CTX_SET_PARAMS: - if (md->ctx_set_params == NULL) - md->ctx_set_params = OSSL_get_OP_digest_ctx_set_params(fns); + case OSSL_FUNC_DIGEST_SET_CTX_PARAMS: + if (md->set_ctx_params == NULL) + md->set_ctx_params = OSSL_get_OP_digest_set_ctx_params(fns); break; - case OSSL_FUNC_DIGEST_CTX_GET_PARAMS: - if (md->ctx_get_params == NULL) - md->ctx_get_params = OSSL_get_OP_digest_ctx_get_params(fns); + case OSSL_FUNC_DIGEST_GET_CTX_PARAMS: + if (md->get_ctx_params == NULL) + md->get_ctx_params = OSSL_get_OP_digest_get_ctx_params(fns); break; case OSSL_FUNC_DIGEST_GETTABLE_PARAMS: if (md->gettable_params == NULL) diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 9e0c01aff9..42d8099ec7 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -1060,15 +1060,15 @@ int EVP_CIPHER_get_params(EVP_CIPHER *cipher, OSSL_PARAM params[]) int EVP_CIPHER_CTX_set_params(EVP_CIPHER_CTX *ctx, const OSSL_PARAM params[]) { - if (ctx->cipher != NULL && ctx->cipher->ctx_set_params != NULL) - return ctx->cipher->ctx_set_params(ctx->provctx, params); + if (ctx->cipher != NULL && ctx->cipher->set_ctx_params != NULL) + return ctx->cipher->set_ctx_params(ctx->provctx, params); return 0; } int EVP_CIPHER_CTX_get_params(EVP_CIPHER_CTX *ctx, OSSL_PARAM params[]) { - if (ctx->cipher != NULL && ctx->cipher->ctx_get_params != NULL) - return ctx->cipher->ctx_get_params(ctx->provctx, params); + if (ctx->cipher != NULL && ctx->cipher->get_ctx_params != NULL) + return ctx->cipher->get_ctx_params(ctx->provctx, params); return 0; } @@ -1244,15 +1244,15 @@ static void *evp_cipher_from_dispatch(const char *name, break; cipher->get_params = OSSL_get_OP_cipher_get_params(fns); break; - case OSSL_FUNC_CIPHER_CTX_GET_PARAMS: - if (cipher->ctx_get_params != NULL) + case OSSL_FUNC_CIPHER_GET_CTX_PARAMS: + if (cipher->get_ctx_params != NULL) break; - cipher->ctx_get_params = OSSL_get_OP_cipher_ctx_get_params(fns); + cipher->get_ctx_params = OSSL_get_OP_cipher_get_ctx_params(fns); break; - case OSSL_FUNC_CIPHER_CTX_SET_PARAMS: - if (cipher->ctx_set_params != NULL) + case OSSL_FUNC_CIPHER_SET_CTX_PARAMS: + if (cipher->set_ctx_params != NULL) break; - cipher->ctx_set_params = OSSL_get_OP_cipher_ctx_set_params(fns); + cipher->set_ctx_params = OSSL_get_OP_cipher_set_ctx_params(fns); break; case OSSL_FUNC_CIPHER_GETTABLE_PARAMS: if (cipher->gettable_params != NULL) diff --git a/crypto/evp/evp_utils.c b/crypto/evp/evp_utils.c index 6355299707..e5cd5b84e1 100644 --- a/crypto/evp/evp_utils.c +++ b/crypto/evp/evp_utils.c @@ -70,10 +70,10 @@ static void seterr(void) PARAM_FUNCTIONS(EVP_CIPHER, evp_do_ciph_getparams, get_params, - evp_do_ciph_ctx_getparams, ctx_get_params, - evp_do_ciph_ctx_setparams, ctx_set_params) + evp_do_ciph_ctx_getparams, get_ctx_params, + evp_do_ciph_ctx_setparams, set_ctx_params) PARAM_FUNCTIONS(EVP_MD, evp_do_md_getparams, get_params, - evp_do_md_ctx_getparams, ctx_get_params, - evp_do_md_ctx_setparams, ctx_set_params) + evp_do_md_ctx_getparams, get_ctx_params, + evp_do_md_ctx_setparams, set_ctx_params) diff --git a/crypto/evp/mac_lib.c b/crypto/evp/mac_lib.c index 7b07b55e3d..a416687577 100644 --- a/crypto/evp/mac_lib.c +++ b/crypto/evp/mac_lib.c @@ -90,8 +90,8 @@ size_t EVP_MAC_size(EVP_MAC_CTX *ctx) OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END }; params[0] = OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_OUTLEN, &sz); - if (ctx->meth->ctx_get_params != NULL) { - if (ctx->meth->ctx_get_params(ctx->data, params)) + if (ctx->meth->get_ctx_params != NULL) { + if (ctx->meth->get_ctx_params(ctx->data, params)) return sz; } else if (ctx->meth->get_params != NULL) { if (ctx->meth->get_params(params)) @@ -146,14 +146,14 @@ int EVP_MAC_get_params(EVP_MAC *mac, OSSL_PARAM params[]) int EVP_MAC_CTX_get_params(EVP_MAC_CTX *ctx, OSSL_PARAM params[]) { - if (ctx->meth->ctx_get_params != NULL) - return ctx->meth->ctx_get_params(ctx->data, params); + if (ctx->meth->get_ctx_params != NULL) + return ctx->meth->get_ctx_params(ctx->data, params); return 1; } int EVP_MAC_CTX_set_params(EVP_MAC_CTX *ctx, const OSSL_PARAM params[]) { - if (ctx->meth->ctx_set_params != NULL) - return ctx->meth->ctx_set_params(ctx->data, params); + if (ctx->meth->set_ctx_params != NULL) + return ctx->meth->set_ctx_params(ctx->data, params); return 1; } diff --git a/crypto/evp/mac_meth.c b/crypto/evp/mac_meth.c index e5eed33774..1c0d6425f7 100644 --- a/crypto/evp/mac_meth.c +++ b/crypto/evp/mac_meth.c @@ -120,15 +120,15 @@ static void *evp_mac_from_dispatch(const char *name, const OSSL_DISPATCH *fns, break; mac->get_params = OSSL_get_OP_mac_get_params(fns); break; - case OSSL_FUNC_MAC_CTX_GET_PARAMS: - if (mac->ctx_get_params != NULL) + case OSSL_FUNC_MAC_GET_CTX_PARAMS: + if (mac->get_ctx_params != NULL) break; - mac->ctx_get_params = OSSL_get_OP_mac_ctx_get_params(fns); + mac->get_ctx_params = OSSL_get_OP_mac_get_ctx_params(fns); break; - case OSSL_FUNC_MAC_CTX_SET_PARAMS: - if (mac->ctx_set_params != NULL) + case OSSL_FUNC_MAC_SET_CTX_PARAMS: + if (mac->set_ctx_params != NULL) break; - mac->ctx_set_params = OSSL_get_OP_mac_ctx_set_params(fns); + mac->set_ctx_params = OSSL_get_OP_mac_set_ctx_params(fns); break; } } diff --git a/crypto/include/internal/evp_int.h b/crypto/include/internal/evp_int.h index fb443b1484..7b1c6aa9c2 100644 --- a/crypto/include/internal/evp_int.h +++ b/crypto/include/internal/evp_int.h @@ -138,8 +138,8 @@ struct evp_mac_st { OSSL_OP_mac_gettable_ctx_params_fn *gettable_ctx_params; OSSL_OP_mac_settable_ctx_params_fn *settable_ctx_params; OSSL_OP_mac_get_params_fn *get_params; - OSSL_OP_mac_ctx_get_params_fn *ctx_get_params; - OSSL_OP_mac_ctx_set_params_fn *ctx_set_params; + OSSL_OP_mac_get_ctx_params_fn *get_ctx_params; + OSSL_OP_mac_set_ctx_params_fn *set_ctx_params; }; /* Internal keccak algorithms used for KMAC */ @@ -211,8 +211,8 @@ struct evp_md_st { OSSL_OP_digest_freectx_fn *freectx; OSSL_OP_digest_dupctx_fn *dupctx; OSSL_OP_digest_get_params_fn *get_params; - OSSL_OP_digest_ctx_set_params_fn *ctx_set_params; - OSSL_OP_digest_ctx_get_params_fn *ctx_get_params; + OSSL_OP_digest_set_ctx_params_fn *set_ctx_params; + OSSL_OP_digest_get_ctx_params_fn *get_ctx_params; OSSL_OP_digest_gettable_params_fn *gettable_params; OSSL_OP_digest_settable_ctx_params_fn *settable_ctx_params; OSSL_OP_digest_gettable_ctx_params_fn *gettable_ctx_params; @@ -265,8 +265,8 @@ struct evp_cipher_st { OSSL_OP_cipher_freectx_fn *freectx; OSSL_OP_cipher_dupctx_fn *dupctx; OSSL_OP_cipher_get_params_fn *get_params; - OSSL_OP_cipher_ctx_get_params_fn *ctx_get_params; - OSSL_OP_cipher_ctx_set_params_fn *ctx_set_params; + OSSL_OP_cipher_get_ctx_params_fn *get_ctx_params; + OSSL_OP_cipher_set_ctx_params_fn *set_ctx_params; OSSL_OP_cipher_gettable_params_fn *gettable_params; OSSL_OP_cipher_gettable_ctx_params_fn *gettable_ctx_params; OSSL_OP_cipher_settable_ctx_params_fn *settable_ctx_params; diff --git a/doc/man7/provider-cipher.pod b/doc/man7/provider-cipher.pod index 33e0a4f004..87ab3d844d 100644 --- a/doc/man7/provider-cipher.pod +++ b/doc/man7/provider-cipher.pod @@ -47,8 +47,8 @@ provider-cipher - The cipher library E<lt>-E<gt> provider functions int OP_cipher_get_params(OSSL_PARAM params[]); /* Cipher operation parameters */ - int OP_cipher_ctx_get_params(void *cctx, OSSL_PARAM params[]); - int OP_cipher_ctx_set_params(void *cctx, const OSSL_PARAM params[]); + int OP_cipher_get_ctx_params(void *cctx, OSSL_PARAM params[]); + int OP_cipher_set_ctx_params(void *cctx, const OSSL_PARAM params[]); =head1 DESCRIPTION @@ -90,8 +90,8 @@ macros in L<openssl-core_numbers.h(7)>, as follows: OP_cipher_cipher OSSL_FUNC_CIPHER_CIPHER OP_cipher_get_params OSSL_FUNC_CIPHER_GET_PARAMS - OP_cipher_ctx_get_params OSSL_FUNC_CIPHER_CTX_GET_PARAMS - OP_cipher_ctx_set_params OSSL_FUNC_CIPHER_CTX_SET_PARAMS + OP_cipher_get_ctx_params OSSL_FUNC_CIPHER_GET_CTX_PARAMS + OP_cipher_set_ctx_params OSSL_FUNC_CIPHER_SET_CTX_PARAMS OP_cipher_gettable_params OSSL_FUNC_CIPHER_GETTABLE_PARAMS OP_cipher_gettable_ctx_params OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS @@ -179,17 +179,17 @@ these functions. OP_cipher_get_params() gets details of the algorithm implementation and stores them in B<params>. -OP_cipher_ctx_set_params() sets cipher operation parameters for the +OP_cipher_set_ctx_params() sets cipher operation parameters for the provider side cipher context B<cctx> to B<params>. Any parameter settings are additional to any that were previously set. -OP_cipher_ctx_get_params() gets cipher operation details details from +OP_cipher_get_ctx_params() gets cipher operation details details from the given provider side cipher context B<cctx> and stores them in B<params>. OP_cipher_gettable_params(), OP_cipher_gettable_ctx_params(), and OP_cipher_settable_ctx_params() all return constant B<OSSL_PARAM> arrays as descriptors of the parameters that OP_cipher_get_params(), -OP_cipher_ctx_get_params(), and OP_cipher_ctx_set_params() can handle, +OP_cipher_get_ctx_params(), and OP_cipher_set_ctx_params() can handle, respectively. Parameters currently recognised by built-in ciphers are as follows. Not all @@ -311,7 +311,7 @@ provider side cipher context, or NULL on failure. OP_cipher_encrypt_init(), OP_cipher_decrypt_init(), OP_cipher_update(), OP_cipher_final(), OP_cipher_cipher(), OP_cipher_get_params(), -OP_cipher_ctx_get_params() and OP_cipher_ctx_set_params() should return 1 for +OP_cipher_get_ctx_params() and OP_cipher_set_ctx_params() should return 1 for success or 0 on error. =head1 SEE ALSO diff --git a/doc/man7/provider-digest.pod b/doc/man7/provider-digest.pod index 1b71cc19f9..a00e9833b8 100644 --- a/doc/man7/provider-digest.pod +++ b/doc/man7/provider-digest.pod @@ -41,8 +41,8 @@ provider-digest - The digest library E<lt>-E<gt> provider functions int OP_digest_get_params(OSSL_PARAM params[]); /* Digest operation parameters */ - int OP_digest_ctx_set_params(void *dctx, const OSSL_PARAM params[]); - int OP_digest_ctx_get_params(void *dctx, OSSL_PARAM params[]); + int OP_digest_set_ctx_params(void *dctx, const OSSL_PARAM params[]); + int OP_digest_get_ctx_params(void *dctx, OSSL_PARAM params[]); =head1 DESCRIPTION @@ -82,8 +82,8 @@ macros in L<openssl-core_numbers.h(7)>, as follows: OP_digest_digest OSSL_FUNC_DIGEST_DIGEST OP_digest_get_params OSSL_FUNC_DIGEST_GET_PARAMS - OP_digest_ctx_get_params OSSL_FUNC_DIGEST_CTX_GET_PARAMS - OP_digest_ctx_set_params OSSL_FUNC_DIGEST_CTX_SET_PARAMS + OP_digest_get_ctx_params OSSL_FUNC_DIGEST_GET_CTX_PARAMS + OP_digest_set_ctx_params OSSL_FUNC_DIGEST_SET_CTX_PARAMS OP_digest_gettable_params OSSL_FUNC_DIGEST_GETTABLE_PARAMS OP_digest_gettable_ctx_params OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS @@ -146,17 +146,17 @@ these functions. OP_digest_get_params() gets details of the algorithm implementation and stores them in B<params>. -OP_digest_ctx_set_params() sets digest operation parameters for the +OP_digest_set_ctx_params() sets digest operation parameters for the provider side digest context B<dctx> to B<params>. Any parameter settings are additional to any that were previously set. -OP_digest_ctx_get_params() gets digest operation details details from +OP_digest_get_ctx_params() gets digest operation details details from the given provider side digest context B<dctx> and stores them in B<params>. OP_digest_gettable_params(), OP_digest_gettable_ctx_params(), and OP_digest_settable_ctx_params() all return constant B<OSSL_PARAM> arrays as descriptors of the parameters that OP_digest_get_params(), -OP_digest_ctx_get_params(), and OP_digest_ctx_set_params() can handle, +OP_digest_get_ctx_params(), and OP_digest_set_ctx_params() can handle, respectively. Parameters currently recognised by built-in digests with this function @@ -213,12 +213,12 @@ Currently unused. =head2 Digest Context Parameters -OP_digest_ctx_set_params() sets digest parameters associated with the +OP_digest_set_ctx_params() sets digest parameters associated with the given provider side digest context B<dctx> to B<params>. Any parameter settings are additional to any that were previously set. See L<OSSL_PARAM(3)> for further details on the parameters structure. -OP_digest_ctx_get_params() gets details of currently set parameters +OP_digest_get_ctx_params() gets details of currently set parameters values associated with the give provider side digest context B<dctx> and stores them in B<params>. See L<OSSL_PARAM(3)> for further details on the parameters structure. diff --git a/doc/man7/provider-mac.pod b/doc/man7/provider-mac.pod index 65aa0124e5..455231172f 100644 --- a/doc/man7/provider-mac.pod +++ b/doc/man7/provider-mac.pod @@ -29,13 +29,13 @@ provider-mac - The mac library E<lt>-E<gt> provider functions /* MAC parameter descriptors */ const OSSL_PARAM *OP_mac_get_params(void); - const OSSL_PARAM *OP_mac_ctx_get_params(void); - const OSSL_PARAM *OP_mac_ctx_set_params(void); + const OSSL_PARAM *OP_mac_get_ctx_params(void); + const OSSL_PARAM *OP_mac_set_ctx_params(void); /* MAC parameters */ int OP_mac_get_params(OSSL_PARAM params[]); - int OP_mac_ctx_get_params(void *mctx, OSSL_PARAM params[]); - int OP_mac_ctx_set_params(void *mctx, const OSSL_PARAM params[]); + int OP_mac_get_ctx_params(void *mctx, OSSL_PARAM params[]); + int OP_mac_set_ctx_params(void *mctx, const OSSL_PARAM params[]); =head1 DESCRIPTION @@ -74,8 +74,8 @@ macros in L<openssl-core_numbers.h(7)>, as follows: OP_mac_final OSSL_FUNC_MAC_FINAL OP_mac_get_params OSSL_FUNC_MAC_GET_PARAMS - OP_mac_ctx_get_params OSSL_FUNC_MAC_CTX_GET_PARAMS - OP_mac_ctx_set_params OSSL_FUNC_MAC_CTX_SET_PARAMS + OP_mac_get_ctx_params OSSL_FUNC_MAC_GET_CTX_PARAMS + OP_mac_set_ctx_params OSSL_FUNC_MAC_SET_CTX_PARAMS OP_mac_gettable_params OSSL_FUNC_MAC_GETTABLE_PARAMS OP_mac_gettable_ctx_params OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS @@ -132,18 +132,18 @@ these functions. OP_mac_get_params() gets details of parameter values associated with the provider algorithm and stores them in I<params>. -OP_mac_ctx_set_params() sets mac parameters associated with the given +OP_mac_set_ctx_params() sets mac parameters associated with the given provider side mac context I<mctx> to I<params>. Any parameter settings are additional to any that were previously set. -OP_mac_ctx_get_params() gets details of currently set parameter values +OP_mac_get_ctx_params() gets details of currently set parameter values associated with the given provider side mac context I<mctx> and stores them in I<params>. OP_mac_gettable_params(), OP_mac_gettable_ctx_params(), and OP_mac_settable_ctx_params() all return constant B<OSSL_PARAM> arrays as descriptors of the parameters that OP_mac_get_params(), -OP_mac_ctx_get_params(), and OP_mac_ctx_set_params() can handle, +OP_mac_get_ctx_params(), and OP_mac_set_ctx_params() can handle, respectively. Parameters currently recognised by built-in macs are as follows. Not all @@ -228,7 +228,7 @@ OP_mac_newctx() and OP_mac_dupctx() should return the newly created provider side mac context, or NULL on failure. OP_mac_init(), OP_mac_update(), OP_mac_final(), OP_mac_get_params(), -OP_mac_ctx_get_params() and OP_mac_ctx_set_params() should return 1 for +OP_mac_get_ctx_params() and OP_mac_set_ctx_params() should return 1 for success or 0 on error. OP_mac_gettable_params(), OP_mac_gettable_ctx_params() and diff --git a/include/openssl/core_numbers.h b/include/openssl/core_numbers.h index 36eeaf67a8..ad8b345f87 100644 --- a/include/openssl/core_numbers.h +++ b/include/openssl/core_numbers.h @@ -146,8 +146,8 @@ OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,provider_get_reason_strings, # define OSSL_FUNC_DIGEST_FREECTX 6 # define OSSL_FUNC_DIGEST_DUPCTX 7 # define OSSL_FUNC_DIGEST_GET_PARAMS 8 -# define OSSL_FUNC_DIGEST_CTX_SET_PARAMS 9 -# define OSSL_FUNC_DIGEST_CTX_GET_PARAMS 10 +# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9 +# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10 # define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11 # define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12 # define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13 @@ -167,9 +167,9 @@ OSSL_CORE_MAKE_FUNC(void, OP_digest_freectx, (void *dctx)) OSSL_CORE_MAKE_FUNC(void *, OP_digest_dupctx, (void *dctx)) OSSL_CORE_MAKE_FUNC(int, OP_digest_get_params, (OSSL_PARAM params[])) -OSSL_CORE_MAKE_FUNC(int, OP_digest_ctx_set_params, +OSSL_CORE_MAKE_FUNC(int, OP_digest_set_ctx_params, (void *vctx, const OSSL_PARAM params[])) -OSSL_CORE_MAKE_FUNC(int, OP_digest_ctx_get_params, +OSSL_CORE_MAKE_FUNC(int, OP_digest_get_ctx_params, (void *vctx, OSSL_PARAM params[])) OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_digest_gettable_params, (void)) OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_digest_settable_ctx_params, (void)) @@ -188,8 +188,8 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_digest_gettable_ctx_params, (void)) # define OSSL_FUNC_CIPHER_FREECTX 7 # define OSSL_FUNC_CIPHER_DUPCTX 8 # define OSSL_FUNC_CIPHER_GET_PARAMS 9 -# define OSSL_FUNC_CIPHER_CTX_GET_PARAMS 10 -# define OSSL_FUNC_CIPHER_CTX_SET_PARAMS 11 +# define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10 +# define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11 # define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12 # define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13 # define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14 @@ -219,9 +219,9 @@ OSSL_CORE_MAKE_FUNC(int, OP_cipher_cipher, OSSL_CORE_MAKE_FUNC(void, OP_cipher_freectx, (void *cctx)) OSSL_CORE_MAKE_FUNC(void *, OP_cipher_dupctx, (void *cctx)) OSSL_CORE_MAKE_FUNC(int, OP_cipher_get_params, (OSSL_PARAM params[])) -OSSL_CORE_MAKE_FUNC(int, OP_cipher_ctx_get_params, (void *cctx, +OSSL_CORE_MAKE_FUNC(int, OP_cipher_get_ctx_params, (void *cctx, OSSL_PARAM params[])) -OSSL_CORE_MAKE_FUNC(int, OP_cipher_ctx_set_params, (void *cctx, +OSSL_CORE_MAKE_FUNC(int, OP_cipher_set_ctx_params, (void *cctx, const OSSL_PARAM params[])) OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_cipher_gettable_params, (void)) @@ -244,8 +244,8 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_cipher_gettable_ctx_params, # define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS 8 # define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS 9 # define OSSL_FUNC_MAC_GET_PARAMS 10 -# define OSSL_FUNC_MAC_CTX_GET_PARAMS 11 -# define OSSL_FUNC_MAC_CTX_SET_PARAMS 12 +# define OSSL_FUNC_MAC_GET_CTX_PARAMS 11 +# define OSSL_FUNC_MAC_SET_CTX_PARAMS 12 OSSL_CORE_MAKE_FUNC(void *, OP_mac_newctx, (void *provctx)) OSSL_CORE_MAKE_FUNC(void *, OP_mac_dupctx, (void *src)) @@ -261,9 +261,9 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_mac_gettable_params, (void)) OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_mac_gettable_ctx_params, (void)) OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_mac_settable_ctx_params, (void)) OSSL_CORE_MAKE_FUNC(int, OP_mac_get_params, (OSSL_PARAM params[])) -OSSL_CORE_MAKE_FUNC(int, OP_mac_ctx_get_params, +OSSL_CORE_MAKE_FUNC(int, OP_mac_get_ctx_params, (void *mctx, OSSL_PARAM params[])) -OSSL_CORE_MAKE_FUNC(int, OP_mac_ctx_set_params, +OSSL_CORE_MAKE_FUNC(int, OP_mac_set_ctx_params, (void *mctx, const OSSL_PARAM params[])) /*- diff --git a/providers/common/ciphers/aes.c b/providers/common/ciphers/aes.c index 32ae19be3f..c7ab30de23 100644 --- a/providers/common/ciphers/aes.c +++ b/providers/common/ciphers/aes.c @@ -28,8 +28,8 @@ static OSSL_OP_cipher_final_fn aes_stream_final; static OSSL_OP_cipher_cipher_fn aes_cipher; static OSSL_OP_cipher_freectx_fn aes_freectx; static OSSL_OP_cipher_dupctx_fn aes_dupctx; -static OSSL_OP_cipher_ctx_get_params_fn aes_ctx_get_params; -static OSSL_OP_cipher_ctx_set_params_fn aes_ctx_set_params; +static OSSL_OP_cipher_get_ctx_params_fn aes_get_ctx_params; +static OSSL_OP_cipher_set_ctx_params_fn aes_set_ctx_params; static int PROV_AES_KEY_generic_init(PROV_AES_KEY *ctx, const unsigned char *iv, @@ -360,7 +360,7 @@ static void *aes_dupctx(void *ctx) return ret; } -static int aes_ctx_get_params(void *vctx, OSSL_PARAM params[]) +static int aes_get_ctx_params(void *vctx, OSSL_PARAM params[]) { PROV_AES_KEY *ctx = (PROV_AES_KEY *)vctx; OSSL_PARAM *p; @@ -372,26 +372,26 @@ static int aes_ctx_get_params(void *vctx, OSSL_PARAM params[]) } p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_PADDING); if (p != NULL && !OSSL_PARAM_set_int(p, ctx->pad)) { - PROVerr(PROV_F_AES_CTX_GET_PARAMS, PROV_R_FAILED_TO_SET_PARAMETER); + PROVerr(PROV_F_AES_GET_CTX_PARAMS, PROV_R_FAILED_TO_SET_PARAMETER); return 0; } p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV); if (p != NULL && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, AES_BLOCK_SIZE) && !OSSL_PARAM_set_octet_string(p, &ctx->iv, AES_BLOCK_SIZE)) { - PROVerr(PROV_F_AES_CTX_GET_PARAMS, + PROVerr(PROV_F_AES_GET_CTX_PARAMS, PROV_R_FAILED_TO_SET_PARAMETER); return 0; } p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_NUM); if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->num)) { - PROVerr(PROV_F_AES_CTX_GET_PARAMS, + PROVerr(PROV_F_AES_GET_CTX_PARAMS, PROV_R_FAILED_TO_SET_PARAMETER); return 0; } p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN); if (p != NULL && !OSSL_PARAM_set_int(p, ctx->keylen)) { - PROVerr(PROV_F_AES_CTX_GET_PARAMS, + PROVerr(PROV_F_AES_GET_CTX_PARAMS, PROV_R_FAILED_TO_SET_PARAMETER); return 0; } @@ -399,7 +399,7 @@ static int aes_ctx_get_params(void *vctx, OSSL_PARAM params[]) return 1; } -static int aes_ctx_set_params(void *vctx, const OSSL_PARAM params[]) +static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { PROV_AES_KEY *ctx = (PROV_AES_KEY *)vctx; const OSSL_PARAM *p; @@ -409,7 +409,7 @@ static int aes_ctx_set_params(void *vctx, const OSSL_PARAM params[]) int pad; if (!OSSL_PARAM_get_int(p, &pad)) { - PROVerr(PROV_F_AES_CTX_SET_PARAMS, + PROVerr(PROV_F_AES_SET_CTX_PARAMS, PROV_R_FAILED_TO_GET_PARAMETER); return 0; } @@ -420,7 +420,7 @@ static int aes_ctx_set_params(void *vctx, const OSSL_PARAM params[]) int num; if (!OSSL_PARAM_get_int(p, &num)) { - PROVerr(PROV_F_AES_CTX_SET_PARAMS, + PROVerr(PROV_F_AES_SET_CTX_PARAMS, PROV_R_FAILED_TO_GET_PARAMETER); return 0; } @@ -431,7 +431,7 @@ static int aes_ctx_set_params(void *vctx, const OSSL_PARAM params[]) int keylen; if (!OSSL_PARAM_get_int(p, &keylen)) { - PROVerr(PROV_F_AES_CTX_SET_PARAMS, + PROVerr(PROV_F_AES_SET_CTX_PARAMS, PROV_R_FAILED_TO_GET_PARAMETER); return 0; } @@ -451,8 +451,8 @@ static int aes_ctx_set_params(void *vctx, const OSSL_PARAM params[]) { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void))aes_freectx }, \ { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void))aes_dupctx }, \ { OSSL_FUNC_CIPHER_GET_PARAMS, (void (*)(void))aes_##kbits##_##mode##_get_params }, \ - { OSSL_FUNC_CIPHER_CTX_GET_PARAMS, (void (*)(void))aes_ctx_get_params }, \ - { OSSL_FUNC_CIPHER_CTX_SET_PARAMS, (void (*)(void))aes_ctx_set_params }, \ + { OSSL_FUNC_CIPHER_GET_CTX_PARAMS, (void (*)(void))aes_get_ctx_params }, \ + { OSSL_FUNC_CIPHER_SET_CTX_PARAMS, (void (*)(void))aes_set_ctx_params }, \ { 0, NULL } \ }; @@ -467,8 +467,8 @@ static int aes_ctx_set_params(void *vctx, const OSSL_PARAM params[]) { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void))aes_freectx }, \ { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void))aes_dupctx }, \ { OSSL_FUNC_CIPHER_GET_PARAMS, (void (*)(void))aes_##kbits##_##mode##_get_params }, \ - { OSSL_FUNC_CIPHER_CTX_GET_PARAMS, (void (*)(void))aes_ctx_get_params }, \ - { OSSL_FUNC_CIPHER_CTX_SET_PARAMS, (void (*)(void))aes_ctx_set_params }, \ + { OSSL_FUNC_CIPHER_GET_CTX_PARAMS, (void (*)(void))aes_get_ctx_params }, \ + { OSSL_FUNC_CIPHER_SET_CTX_PARAMS, (void (*)(void))aes_set_ctx_params }, \ { 0, NULL } \ }; diff --git a/providers/common/ciphers/gcm.c b/providers/common/ciphers/gcm.c index 164c716483..74c2089fe7 100644 --- a/providers/common/ciphers/gcm.c +++ b/providers/common/ciphers/gcm.c @@ -25,8 +25,8 @@ static OSSL_OP_cipher_encrypt_init_fn gcm_einit; static OSSL_OP_cipher_decrypt_init_fn gcm_dinit; -static OSSL_OP_cipher_ctx_get_params_fn gcm_ctx_get_params; -static OSSL_OP_cipher_ctx_set_params_fn gcm_ctx_set_params; +static OSSL_OP_cipher_get_ctx_params_fn gcm_get_ctx_params; +static OSSL_OP_cipher_set_ctx_params_fn gcm_set_ctx_params; static OSSL_OP_cipher_cipher_fn gcm_cipher; static OSSL_OP_cipher_update_fn gcm_stream_update; static OSSL_OP_cipher_final_fn gcm_stream_final; @@ -98,7 +98,7 @@ static int gcm_dinit(void *vctx, const unsigned char *key, size_t keylen, return gcm_init(vctx, key, keylen, iv, ivlen, 0); } -static int gcm_ctx_get_params(void *vctx, OSSL_PARAM params[]) +static int gcm_get_ctx_params(void *vctx, OSSL_PARAM params[]) { PROV_GCM_CTX *ctx = (PROV_GCM_CTX *)vctx; OSSL_PARAM *p; @@ -149,7 +149,7 @@ static int gcm_ctx_get_params(void *vctx, OSSL_PARAM params[]) return 1; } -static int gcm_ctx_set_params(void *vctx, const OSSL_PARAM params[]) +static int gcm_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { PROV_GCM_CTX *ctx = (PROV_GCM_CTX *)vctx; const OSSL_PARAM *p; @@ -535,10 +535,10 @@ err: { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void)) alg##_gcm_freectx }, \ { OSSL_FUNC_CIPHER_GET_PARAMS, \ (void (*)(void)) alg##_##kbits##_##lcmode##_get_params }, \ - { OSSL_FUNC_CIPHER_CTX_GET_PARAMS, \ - (void (*)(void))gcm_ctx_get_params }, \ - { OSSL_FUNC_CIPHER_CTX_SET_PARAMS, \ - (void (*)(void))gcm_ctx_set_params }, \ + { OSSL_FUNC_CIPHER_GET_CTX_PARAMS, \ + (void (*)(void))gcm_get_ctx_params }, \ + { OSSL_FUNC_CIPHER_SET_CTX_PARAMS, \ + (void (*)(void))gcm_set_ctx_params }, \ |