From 92d9d0ae2b10b12e42d33047b60e64ebfc296596 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 16 Aug 2019 09:04:29 +0200 Subject: 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 (Merged from https://github.com/openssl/openssl/pull/9612) --- providers/default/digests/md5_sha1_prov.c | 6 +++--- providers/default/macs/blake2_mac_impl.c | 12 ++++++------ providers/default/macs/poly1305_prov.c | 6 +++--- providers/default/macs/siphash_prov.c | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'providers/default') diff --git a/providers/default/digests/md5_sha1_prov.c b/providers/default/digests/md5_sha1_prov.c index de40993d93..34cc60206b 100644 --- a/providers/default/digests/md5_sha1_prov.c +++ b/providers/default/digests/md5_sha1_prov.c @@ -17,7 +17,7 @@ #include "internal/md5_sha1.h" #include "internal/provider_algs.h" -static OSSL_OP_digest_ctx_set_params_fn md5_sha1_ctx_set_params; +static OSSL_OP_digest_set_ctx_params_fn md5_sha1_set_ctx_params; static OSSL_OP_digest_settable_ctx_params_fn md5_sha1_settable_ctx_params; static const OSSL_PARAM known_md5_sha1_settable_ctx_params[] = { @@ -31,7 +31,7 @@ static const OSSL_PARAM *md5_sha1_settable_ctx_params(void) } /* Special set_params method for SSL3 */ -static int md5_sha1_ctx_set_params(void *vctx, const OSSL_PARAM params[]) +static int md5_sha1_set_ctx_params(void *vctx, const OSSL_PARAM params[]) { const OSSL_PARAM *p; MD5_SHA1_CTX *ctx = (MD5_SHA1_CTX *)vctx; @@ -49,4 +49,4 @@ OSSL_FUNC_DIGEST_CONSTRUCT_PARAMS(md5_sha1, MD5_SHA1_CTX, MD5_SHA1_CBLOCK, MD5_SHA1_DIGEST_LENGTH, 0, md5_sha1_init, md5_sha1_update, md5_sha1_final, md5_sha1_settable_ctx_params, - md5_sha1_ctx_set_params) + md5_sha1_set_ctx_params) diff --git a/providers/default/macs/blake2_mac_impl.c b/providers/default/macs/blake2_mac_impl.c index 67643e8a6c..4ce9145daf 100644 --- a/providers/default/macs/blake2_mac_impl.c +++ b/providers/default/macs/blake2_mac_impl.c @@ -28,9 +28,9 @@ static OSSL_OP_mac_newctx_fn blake2_mac_new; static OSSL_OP_mac_dupctx_fn blake2_mac_dup; static OSSL_OP_mac_freectx_fn blake2_mac_free; static OSSL_OP_mac_gettable_ctx_params_fn blake2_gettable_ctx_params; -static OSSL_OP_mac_ctx_get_params_fn blake2_ctx_get_params; +static OSSL_OP_mac_get_ctx_params_fn blake2_get_ctx_params; static OSSL_OP_mac_settable_ctx_params_fn blake2_mac_settable_ctx_params; -static OSSL_OP_mac_ctx_set_params_fn blake2_mac_ctx_set_params; +static OSSL_OP_mac_set_ctx_params_fn blake2_mac_set_ctx_params; static OSSL_OP_mac_init_fn blake2_mac_init; static OSSL_OP_mac_update_fn blake2_mac_update; static OSSL_OP_mac_final_fn blake2_mac_final; @@ -117,7 +117,7 @@ static const OSSL_PARAM *blake2_gettable_ctx_params(void) return known_gettable_ctx_params; } -static int blake2_ctx_get_params(void *vmacctx, OSSL_PARAM params[]) +static int blake2_get_ctx_params(void *vmacctx, OSSL_PARAM params[]) { OSSL_PARAM *p; @@ -144,7 +144,7 @@ static const OSSL_PARAM *blake2_mac_settable_ctx_params() /* * ALL parameters should be set before init(). */ -static int blake2_mac_ctx_set_params(void *vmacctx, const OSSL_PARAM params[]) +static int blake2_mac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[]) { struct blake2_mac_data_st *macctx = vmacctx; const OSSL_PARAM *p; @@ -220,10 +220,10 @@ const OSSL_DISPATCH BLAKE2_FUNCTIONS[] = { { OSSL_FUNC_MAC_FINAL, (void (*)(void))blake2_mac_final }, { OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS, (void (*)(void))blake2_gettable_ctx_params }, - { OSSL_FUNC_MAC_CTX_GET_PARAMS, (void (*)(void))blake2_ctx_get_params }, + { OSSL_FUNC_MAC_GET_CTX_PARAMS, (void (*)(void))blake2_get_ctx_params }, { OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS, (void (*)(void))blake2_mac_settable_ctx_params }, - { OSSL_FUNC_MAC_CTX_SET_PARAMS, (void (*)(void))blake2_mac_ctx_set_params }, + { OSSL_FUNC_MAC_SET_CTX_PARAMS, (void (*)(void))blake2_mac_set_ctx_params }, { 0, NULL } }; diff --git a/providers/default/macs/poly1305_prov.c b/providers/default/macs/poly1305_prov.c index c64c2b9e9a..c4e02d125a 100644 --- a/providers/default/macs/poly1305_prov.c +++ b/providers/default/macs/poly1305_prov.c @@ -38,7 +38,7 @@ static OSSL_OP_mac_freectx_fn poly1305_free; static OSSL_OP_mac_gettable_params_fn poly1305_gettable_params; static OSSL_OP_mac_get_params_fn poly1305_get_params; static OSSL_OP_mac_settable_ctx_params_fn poly1305_settable_ctx_params; -static OSSL_OP_mac_ctx_set_params_fn poly1305_ctx_set_params; +static OSSL_OP_mac_set_ctx_params_fn poly1305_set_ctx_params; static OSSL_OP_mac_init_fn poly1305_init; static OSSL_OP_mac_update_fn poly1305_update; static OSSL_OP_mac_final_fn poly1305_final; @@ -135,7 +135,7 @@ static const OSSL_PARAM *poly1305_settable_ctx_params(void) return known_settable_ctx_params; } -static int poly1305_ctx_set_params(void *vmacctx, const OSSL_PARAM *params) +static int poly1305_set_ctx_params(void *vmacctx, const OSSL_PARAM *params) { struct poly1305_data_st *ctx = vmacctx; const OSSL_PARAM *p = NULL; @@ -162,7 +162,7 @@ const OSSL_DISPATCH poly1305_functions[] = { { OSSL_FUNC_MAC_GET_PARAMS, (void (*)(void))poly1305_get_params }, { OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS, (void (*)(void))poly1305_settable_ctx_params }, - { OSSL_FUNC_MAC_CTX_SET_PARAMS, (void (*)(void))poly1305_ctx_set_params }, + { OSSL_FUNC_MAC_SET_CTX_PARAMS, (void (*)(void))poly1305_set_ctx_params }, { 0, NULL } }; diff --git a/providers/default/macs/siphash_prov.c b/providers/default/macs/siphash_prov.c index f02834f082..3a477256d5 100644 --- a/providers/default/macs/siphash_prov.c +++ b/providers/default/macs/siphash_prov.c @@ -37,9 +37,9 @@ static OSSL_OP_mac_newctx_fn siphash_new; static OSSL_OP_mac_dupctx_fn siphash_dup; static OSSL_OP_mac_freectx_fn siphash_free; static OSSL_OP_mac_gettable_ctx_params_fn siphash_gettable_ctx_params; -static OSSL_OP_mac_ctx_get_params_fn siphash_ctx_get_params; +static OSSL_OP_mac_get_ctx_params_fn siphash_get_ctx_params; static OSSL_OP_mac_settable_ctx_params_fn siphash_settable_params; -static OSSL_OP_mac_ctx_set_params_fn siphash_set_params; +static OSSL_OP_mac_set_ctx_params_fn siphash_set_params; static OSSL_OP_mac_size_fn siphash_size; static OSSL_OP_mac_init_fn siphash_init; static OSSL_OP_mac_update_fn siphash_update; @@ -121,7 +121,7 @@ static const OSSL_PARAM *siphash_gettable_ctx_params(void) return known_gettable_ctx_params; } -static int siphash_ctx_get_params(void *vmacctx, OSSL_PARAM params[]) +static int siphash_get_ctx_params(void *vmacctx, OSSL_PARAM params[]) { OSSL_PARAM *p; @@ -178,10 +178,10 @@ const OSSL_DISPATCH siphash_functions[] = { { OSSL_FUNC_MAC_FINAL, (void (*)(void))siphash_final }, { OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS, (void (*)(void))siphash_gettable_ctx_params }, - { OSSL_FUNC_MAC_CTX_GET_PARAMS, (void (*)(void))siphash_ctx_get_params }, + { OSSL_FUNC_MAC_GET_CTX_PARAMS, (void (*)(void))siphash_get_ctx_params }, { OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS, (void (*)(void))siphash_settable_params }, - { OSSL_FUNC_MAC_CTX_SET_PARAMS, (void (*)(void))siphash_set_params }, + { OSSL_FUNC_MAC_SET_CTX_PARAMS, (void (*)(void))siphash_set_params }, { 0, NULL } }; -- cgit v1.2.3