Consistent naming for context gettable param queries .

All instances of EVP_*_CTX_gettable_params functions have been renamed
to EVP_*_gettable_ctx_params.  Except for the EVP_MD ones which were changed
already.

These functions do not take EVP_*_CTX arguments so their prior naming was
misleading.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10052)
This commit is contained in:
Pauli 2019-09-27 16:35:45 +10:00
parent e0d952fccf
commit 41f7ecf30d
18 changed files with 52 additions and 52 deletions

View File

@ -341,7 +341,7 @@ opthelp:
if (opts != NULL) {
int ok = 1;
OSSL_PARAM *params =
app_params_new_from_opts(opts, EVP_MAC_CTX_settable_params(mac));
app_params_new_from_opts(opts, EVP_MAC_settable_ctx_params(mac));
if (params == NULL)
goto end;

View File

@ -96,7 +96,7 @@ opthelp:
if (opts != NULL) {
int ok = 1;
OSSL_PARAM *params =
app_params_new_from_opts(opts, EVP_KDF_CTX_settable_params(kdf));
app_params_new_from_opts(opts, EVP_KDF_settable_ctx_params(kdf));
if (params == NULL)
goto err;

View File

@ -76,9 +76,9 @@ static void list_ciphers(void)
print_param_types("retrievable algorithm parameters",
EVP_CIPHER_gettable_params(c), 4);
print_param_types("retrievable operation parameters",
EVP_CIPHER_CTX_gettable_params(c), 4);
EVP_CIPHER_gettable_ctx_params(c), 4);
print_param_types("settable operation parameters",
EVP_CIPHER_CTX_settable_params(c), 4);
EVP_CIPHER_settable_ctx_params(c), 4);
}
}
sk_EVP_CIPHER_pop_free(ciphers, EVP_CIPHER_free);
@ -186,9 +186,9 @@ static void list_macs(void)
print_param_types("retrievable algorithm parameters",
EVP_MAC_gettable_params(m), 4);
print_param_types("retrievable operation parameters",
EVP_MAC_CTX_gettable_params(m), 4);
EVP_MAC_gettable_ctx_params(m), 4);
print_param_types("settable operation parameters",
EVP_MAC_CTX_settable_params(m), 4);
EVP_MAC_settable_ctx_params(m), 4);
}
}
sk_EVP_MAC_pop_free(macs, EVP_MAC_free);
@ -236,9 +236,9 @@ static void list_kdfs(void)
print_param_types("retrievable algorithm parameters",
EVP_KDF_gettable_params(m), 4);
print_param_types("retrievable operation parameters",
EVP_KDF_CTX_gettable_params(m), 4);
EVP_KDF_gettable_ctx_params(m), 4);
print_param_types("settable operation parameters",
EVP_KDF_CTX_settable_params(m), 4);
EVP_KDF_settable_ctx_params(m), 4);
}
}
sk_EVP_KDF_pop_free(kdfs, EVP_KDF_free);

View File

@ -105,7 +105,7 @@ opthelp:
if (opts != NULL) {
int ok = 1;
OSSL_PARAM *params =
app_params_new_from_opts(opts, EVP_MAC_CTX_settable_params(mac));
app_params_new_from_opts(opts, EVP_MAC_settable_ctx_params(mac));
if (params == NULL)
goto err;

View File

@ -108,8 +108,8 @@ static void do_cipher(EVP_CIPHER *cipher, void *meta)
{
do_method(cipher, EVP_CIPHER_name(cipher),
EVP_CIPHER_gettable_params(cipher),
EVP_CIPHER_CTX_gettable_params(cipher),
EVP_CIPHER_CTX_settable_params(cipher),
EVP_CIPHER_gettable_ctx_params(cipher),
EVP_CIPHER_settable_ctx_params(cipher),
meta);
}
@ -126,8 +126,8 @@ static void do_mac(EVP_MAC *mac, void *meta)
{
do_method(mac, EVP_MAC_name(mac),
EVP_MAC_gettable_params(mac),
EVP_MAC_CTX_gettable_params(mac),
EVP_MAC_CTX_settable_params(mac),
EVP_MAC_gettable_ctx_params(mac),
EVP_MAC_settable_ctx_params(mac),
meta);
}

View File

@ -1181,14 +1181,14 @@ const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher)
return NULL;
}
const OSSL_PARAM *EVP_CIPHER_CTX_settable_params(const EVP_CIPHER *cipher)
const OSSL_PARAM *EVP_CIPHER_settable_ctx_params(const EVP_CIPHER *cipher)
{
if (cipher != NULL && cipher->settable_ctx_params != NULL)
return cipher->settable_ctx_params();
return NULL;
}
const OSSL_PARAM *EVP_CIPHER_CTX_gettable_params(const EVP_CIPHER *cipher)
const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher)
{
if (cipher != NULL && cipher->gettable_ctx_params != NULL)
return cipher->gettable_ctx_params();

View File

@ -173,14 +173,14 @@ const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf)
return kdf->gettable_params();
}
const OSSL_PARAM *EVP_KDF_CTX_gettable_params(const EVP_KDF *kdf)
const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf)
{
if (kdf->gettable_ctx_params == NULL)
return NULL;
return kdf->gettable_ctx_params();
}
const OSSL_PARAM *EVP_KDF_CTX_settable_params(const EVP_KDF *kdf)
const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf)
{
if (kdf->settable_ctx_params == NULL)
return NULL;

View File

@ -190,14 +190,14 @@ const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac)
return mac->gettable_params();
}
const OSSL_PARAM *EVP_MAC_CTX_gettable_params(const EVP_MAC *mac)
const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac)
{
if (mac->gettable_ctx_params == NULL)
return NULL;
return mac->gettable_ctx_params();
}
const OSSL_PARAM *EVP_MAC_CTX_settable_params(const EVP_MAC *mac)
const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac)
{
if (mac->settable_ctx_params == NULL)
return NULL;

View File

@ -213,7 +213,7 @@ static int pkey_kdf_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
EVP_KDF_CTX *kctx = pkctx->kctx;
const EVP_KDF *kdf = EVP_KDF_CTX_kdf(kctx);
BUF_MEM **collector = NULL;
const OSSL_PARAM *defs = EVP_KDF_CTX_settable_params(kdf);
const OSSL_PARAM *defs = EVP_KDF_settable_ctx_params(kdf);
OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
int ok = 0;

View File

@ -452,7 +452,7 @@ static int pkey_mac_ctrl_str(EVP_PKEY_CTX *ctx,
type = OSSL_MAC_PARAM_SIZE;
if (!OSSL_PARAM_allocate_from_text(&params[0],
EVP_MAC_CTX_settable_params(mac),
EVP_MAC_settable_ctx_params(mac),
type, value, strlen(value) + 1))
return 0;
params[1] = OSSL_PARAM_construct_end();

View File

@ -44,9 +44,9 @@ EVP_CIPHER_CTX_cipher,
EVP_CIPHER_CTX_name,
EVP_CIPHER_CTX_nid,
EVP_CIPHER_CTX_get_params,
EVP_CIPHER_CTX_gettable_params,
EVP_CIPHER_gettable_ctx_params,
EVP_CIPHER_CTX_set_params,
EVP_CIPHER_CTX_settable_params,
EVP_CIPHER_settable_ctx_params,
EVP_CIPHER_CTX_block_size,
EVP_CIPHER_CTX_key_length,
EVP_CIPHER_CTX_iv_length,
@ -135,8 +135,8 @@ EVP_CIPHER_do_all_ex
int EVP_CIPHER_CTX_set_params(EVP_CIPHER_CTX *ctx, const OSSL_PARAM params[]);
int EVP_CIPHER_CTX_get_params(EVP_CIPHER_CTX *ctx, OSSL_PARAM params[]);
const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher);
const OSSL_PARAM *EVP_CIPHER_CTX_settable_params(const EVP_CIPHER *cipher);
const OSSL_PARAM *EVP_CIPHER_CTX_gettable_params(const EVP_CIPHER *cipher);
const OSSL_PARAM *EVP_CIPHER_settable_ctx_params(const EVP_CIPHER *cipher);
const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher);
int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
@ -278,8 +278,8 @@ context B<ctx>.
EVP_CIPHER_CTX_get_params() retrieves the requested list of operation
B<params> from CIPHER context B<ctx>.
EVP_CIPHER_gettable_params(), EVP_CIPHER_CTX_gettable_params(), and
EVP_CIPHER_CTX_settable_params() get a constant B<OSSL_PARAM> array
EVP_CIPHER_gettable_params(), EVP_CIPHER_gettable_ctx_params(), and
EVP_CIPHER_settable_ctx_params() get a constant B<OSSL_PARAM> array
that decribes the retrievable and settable parameters, i.e. parameters
that can be used with EVP_CIPHER_get_params(), EVP_CIPHER_CTX_get_params()
and EVP_CIPHER_CTX_set_params(), respectively.

View File

@ -7,7 +7,7 @@ EVP_KDF_name,
EVP_KDF_CTX, EVP_KDF_CTX_new, EVP_KDF_CTX_free, EVP_KDF_CTX_kdf,
EVP_KDF_reset, EVP_KDF_size, EVP_KDF_derive, EVP_KDF_CTX_dup,
EVP_KDF_CTX_get_params, EVP_KDF_CTX_set_params, EVP_KDF_do_all_ex,
EVP_KDF_get_params, EVP_KDF_CTX_gettable_params, EVP_KDF_CTX_settable_params,
EVP_KDF_get_params, EVP_KDF_gettable_ctx_params, EVP_KDF_settable_ctx_params,
EVP_KDF_gettable_params - EVP KDF routines
=head1 SYNOPSIS
@ -36,8 +36,8 @@ EVP_KDF_gettable_params - EVP KDF routines
int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]);
int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[]);
const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_CTX_gettable_params(const EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_CTX_settable_params(const EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf);
const OSSL_PROVIDER *EVP_KDF_provider(const EVP_KDF *kdf);
=head1 DESCRIPTION
@ -114,8 +114,8 @@ simply ignored.
Also, what happens when a needed parameter isn't passed down is
defined by the implementation.
EVP_KDF_gettable_params(), EVP_KDF_CTX_gettable_params() and
EVP_KDF_CTX_settable_params() get a constant B<OSSL_PARAM> array that
EVP_KDF_gettable_params(), EVP_KDF_gettable_ctx_params() and
EVP_KDF_settable_ctx_params() get a constant B<OSSL_PARAM> array that
decribes the retrievable and settable parameters, i.e. parameters that
can be used with EVP_KDF_get_params(), EVP_KDF_CTX_get_params()
and EVP_KDF_CTX_set_params(), respectively.

View File

@ -8,7 +8,7 @@ EVP_MAC_provider, EVP_MAC_get_params, EVP_MAC_gettable_params,
EVP_MAC_CTX, EVP_MAC_CTX_new, EVP_MAC_CTX_free, EVP_MAC_CTX_dup,
EVP_MAC_CTX_mac, EVP_MAC_CTX_get_params, EVP_MAC_CTX_set_params,
EVP_MAC_size, EVP_MAC_init, EVP_MAC_update, EVP_MAC_final,
EVP_MAC_CTX_gettable_params, EVP_MAC_CTX_settable_params,
EVP_MAC_gettable_ctx_params, EVP_MAC_settable_ctx_params,
EVP_MAC_do_all_ex - EVP MAC routines
=head1 SYNOPSIS
@ -41,8 +41,8 @@ EVP_MAC_do_all_ex - EVP MAC routines
unsigned char *out, size_t *outl, size_t outsize);
const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_CTX_gettable_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_CTX_settable_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
void EVP_MAC_do_all_ex(OPENSSL_CTX *libctx,
void (*fn)(EVP_MAC *mac, void *arg),
@ -146,8 +146,8 @@ simply ignored.
Also, what happens when a needed parameter isn't passed down is
defined by the implementation.
EVP_MAC_gettable_params(), EVP_MAC_CTX_gettable_params() and
EVP_MAC_CTX_settable_params() get a constant B<OSSL_PARAM> array that
EVP_MAC_gettable_params(), EVP_MAC_gettable_ctx_params() and
EVP_MAC_settable_ctx_params() get a constant B<OSSL_PARAM> array that
decribes the retrievable and settable parameters, i.e. parameters that
can be used with EVP_MAC_get_params(), EVP_MAC_CTX_get_params()
and EVP_MAC_CTX_set_params(), respectively.

View File

@ -120,7 +120,7 @@ Can be written like this instead:
OSSL_PARAM *params =
OPENSSL_zalloc(sizeof(*params)
* (sk_OPENSSL_STRING_num(opts) + 1));
const OSSL_PARAM *paramdefs = EVP_MAC_CTX_settable_params(mac);
const OSSL_PARAM *paramdefs = EVP_MAC_settable_ctx_params(mac);
size_t params_n;
char *opt = "<unknown>";

View File

@ -723,8 +723,8 @@ 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[]);
int EVP_CIPHER_CTX_get_params(EVP_CIPHER_CTX *ctx, OSSL_PARAM params[]);
const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher);
const OSSL_PARAM *EVP_CIPHER_CTX_settable_params(const EVP_CIPHER *cipher);
const OSSL_PARAM *EVP_CIPHER_CTX_gettable_params(const EVP_CIPHER *cipher);
const OSSL_PARAM *EVP_CIPHER_settable_ctx_params(const EVP_CIPHER *cipher);
const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher);
const BIO_METHOD *BIO_f_md(void);
const BIO_METHOD *BIO_f_base64(void);
@ -1060,8 +1060,8 @@ int EVP_MAC_update(EVP_MAC_CTX *ctx, const unsigned char *data, size_t datalen);
int EVP_MAC_final(EVP_MAC_CTX *ctx,
unsigned char *out, size_t *outl, size_t outsize);
const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_CTX_gettable_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_CTX_settable_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
void EVP_MAC_do_all_ex(OPENSSL_CTX *libctx,
void (*fn)(EVP_MAC *mac, void *arg),

View File

@ -44,8 +44,8 @@ int EVP_KDF_get_params(EVP_KDF *kdf, OSSL_PARAM params[]);
int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]);
int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[]);
const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_CTX_gettable_params(const EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_CTX_settable_params(const EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf);
const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf);
void EVP_KDF_do_all_ex(OPENSSL_CTX *libctx,
void (*fn)(EVP_KDF *kdf, void *arg),

View File

@ -1161,7 +1161,7 @@ static int mac_test_run_mac(EVP_TEST *t)
size_t params_n = 0;
size_t params_n_allocstart = 0;
const OSSL_PARAM *defined_params =
EVP_MAC_CTX_settable_params(expected->mac);
EVP_MAC_settable_ctx_params(expected->mac);
if (expected->alg == NULL)
TEST_info("Trying the EVP_MAC %s test", EVP_MAC_name(expected->mac));
@ -2054,7 +2054,7 @@ static int kdf_test_ctrl(EVP_TEST *t, EVP_KDF_CTX *kctx,
KDF_DATA *kdata = t->data;
int rv;
char *p, *name;
const OSSL_PARAM *defs = EVP_KDF_CTX_settable_params(EVP_KDF_CTX_kdf(kctx));
const OSSL_PARAM *defs = EVP_KDF_settable_ctx_params(EVP_KDF_CTX_kdf(kctx));
if (!TEST_ptr(name = OPENSSL_strdup(value)))
return 0;

View File

@ -4708,14 +4708,14 @@ EVP_CIPHER_get_params 4824 3_0_0 EXIST::FUNCTION:
EVP_CIPHER_CTX_set_params 4825 3_0_0 EXIST::FUNCTION:
EVP_CIPHER_CTX_get_params 4826 3_0_0 EXIST::FUNCTION:
EVP_CIPHER_gettable_params 4827 3_0_0 EXIST::FUNCTION:
EVP_CIPHER_CTX_settable_params 4828 3_0_0 EXIST::FUNCTION:
EVP_CIPHER_CTX_gettable_params 4829 3_0_0 EXIST::FUNCTION:
EVP_CIPHER_settable_ctx_params 4828 3_0_0 EXIST::FUNCTION:
EVP_CIPHER_gettable_ctx_params 4829 3_0_0 EXIST::FUNCTION:
EVP_MD_get_params 4830 3_0_0 EXIST::FUNCTION:
EVP_MAC_fetch 4831 3_0_0 EXIST::FUNCTION:
EVP_MAC_CTX_settable_params 4832 3_0_0 EXIST::FUNCTION:
EVP_MAC_settable_ctx_params 4832 3_0_0 EXIST::FUNCTION:
EVP_MAC_CTX_set_params 4833 3_0_0 EXIST::FUNCTION:
EVP_MAC_CTX_get_params 4834 3_0_0 EXIST::FUNCTION:
EVP_MAC_CTX_gettable_params 4835 3_0_0 EXIST::FUNCTION:
EVP_MAC_gettable_ctx_params 4835 3_0_0 EXIST::FUNCTION:
EVP_MAC_free 4836 3_0_0 EXIST::FUNCTION:
EVP_MAC_up_ref 4837 3_0_0 EXIST::FUNCTION:
EVP_MAC_name 4838 3_0_0 EXIST::FUNCTION:
@ -4735,8 +4735,8 @@ EVP_KDF_get_params 4851 3_0_0 EXIST::FUNCTION:
EVP_KDF_CTX_get_params 4852 3_0_0 EXIST::FUNCTION:
EVP_KDF_CTX_set_params 4853 3_0_0 EXIST::FUNCTION:
EVP_KDF_gettable_params 4854 3_0_0 EXIST::FUNCTION:
EVP_KDF_CTX_gettable_params 4855 3_0_0 EXIST::FUNCTION:
EVP_KDF_CTX_settable_params 4856 3_0_0 EXIST::FUNCTION:
EVP_KDF_gettable_ctx_params 4855 3_0_0 EXIST::FUNCTION:
EVP_KDF_settable_ctx_params 4856 3_0_0 EXIST::FUNCTION:
EVP_KDF_do_all_ex 4857 3_0_0 EXIST::FUNCTION:
EVP_SIGNATURE_free 4858 3_0_0 EXIST::FUNCTION:
EVP_SIGNATURE_up_ref 4859 3_0_0 EXIST::FUNCTION: