[openssl] master update
Dr. Paul Dale
pauli at openssl.org
Sat Apr 17 08:22:39 UTC 2021
The branch master has been updated
via e494fac705057c91017b41fa761f9406c87f4cc5 (commit)
from 7b9f02798f68d9108623f5879f3fc73c06f9a2c7 (commit)
- Log -----------------------------------------------------------------
commit e494fac705057c91017b41fa761f9406c87f4cc5
Author: Pauli <pauli at openssl.org>
Date: Fri Apr 16 09:13:43 2021 +1000
Fix naming for EVP_RAND_CTX_gettable functions.
Change:
EVP_RAND_gettable_ctx_params -> EVP_RAND_CTX_gettable_params
EVP_RAND_settable_ctx_params -> EVP_RAND_CTX_settable_params
Which brings them in line with the other similar functions for other algorithm
types.
Fixes #14880
Reviewed-by: Tim Hudson <tjh at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14893)
-----------------------------------------------------------------------
Summary of changes:
apps/list.c | 2 +-
crypto/evp/evp_rand.c | 6 +++---
doc/man3/EVP_RAND.pod | 14 +++++++-------
doc/man7/life_cycle-rand.pod | 8 ++++----
include/openssl/evp.h | 4 ++--
providers/fips/self_test_kats.c | 8 ++++----
test/acvp_test.c | 6 +++---
test/drbgtest.c | 8 ++++----
test/evp_extra_test.c | 2 +-
test/evp_test.c | 10 +++++-----
util/libcrypto.num | 4 ++--
11 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/apps/list.c b/apps/list.c
index df87880ba7..af6ae3f1a0 100644
--- a/apps/list.c
+++ b/apps/list.c
@@ -444,7 +444,7 @@ static void display_random(const char *name, EVP_RAND_CTX *drbg)
params->data_size = sizeof(buf);
}
params->return_size = 0;
- if (EVP_RAND_get_ctx_params(drbg, params))
+ if (EVP_RAND_CTX_get_params(drbg, params))
print_param_value(params, 2);
}
}
diff --git a/crypto/evp/evp_rand.c b/crypto/evp/evp_rand.c
index cae21891ee..2444be5dea 100644
--- a/crypto/evp/evp_rand.c
+++ b/crypto/evp/evp_rand.c
@@ -397,7 +397,7 @@ static int evp_rand_get_ctx_params_locked(EVP_RAND_CTX *ctx,
return ctx->meth->get_ctx_params(ctx->data, params);
}
-int EVP_RAND_get_ctx_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[])
+int EVP_RAND_CTX_get_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[])
{
int res;
@@ -416,7 +416,7 @@ static int evp_rand_set_ctx_params_locked(EVP_RAND_CTX *ctx,
return 1;
}
-int EVP_RAND_set_ctx_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[])
+int EVP_RAND_CTX_set_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[])
{
int res;
@@ -653,7 +653,7 @@ int EVP_RAND_state(EVP_RAND_CTX *ctx)
int state;
params[0] = OSSL_PARAM_construct_int(OSSL_RAND_PARAM_STATE, &state);
- if (!EVP_RAND_get_ctx_params(ctx, params))
+ if (!EVP_RAND_CTX_get_params(ctx, params))
state = EVP_RAND_STATE_ERROR;
return state;
}
diff --git a/doc/man3/EVP_RAND.pod b/doc/man3/EVP_RAND.pod
index 23906da5ba..b2d1e18417 100644
--- a/doc/man3/EVP_RAND.pod
+++ b/doc/man3/EVP_RAND.pod
@@ -9,8 +9,8 @@ EVP_RAND_enable_locking, EVP_RAND_verify_zeroization, EVP_RAND_strength,
EVP_RAND_state,
EVP_RAND_provider, EVP_RAND_CTX_rand, EVP_RAND_is_a, EVP_RAND_number,
EVP_RAND_name, EVP_RAND_names_do_all, EVP_RAND_description,
-EVP_RAND_get_ctx_params,
-EVP_RAND_set_ctx_params, EVP_RAND_do_all_provided, EVP_RAND_get_params,
+EVP_RAND_CTX_get_params,
+EVP_RAND_CTX_set_params, EVP_RAND_do_all_provided, EVP_RAND_get_params,
EVP_RAND_gettable_ctx_params, EVP_RAND_settable_ctx_params,
EVP_RAND_CTX_gettable_params, EVP_RAND_CTX_settable_params,
EVP_RAND_gettable_params, EVP_RAND_STATE_UNINITIALISED, EVP_RAND_STATE_READY,
@@ -31,8 +31,8 @@ EVP_RAND_STATE_ERROR - EVP RAND routines
void EVP_RAND_CTX_free(EVP_RAND_CTX *ctx);
EVP_RAND *EVP_RAND_CTX_rand(EVP_RAND_CTX *ctx);
int EVP_RAND_get_params(EVP_RAND *rand, OSSL_PARAM params[]);
- int EVP_RAND_get_ctx_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]);
- int EVP_RAND_set_ctx_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]);
+ int EVP_RAND_CTX_get_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]);
+ int EVP_RAND_CTX_set_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]);
const OSSL_PARAM *EVP_RAND_gettable_params(const EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_gettable_ctx_params(const EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_settable_ctx_params(const EVP_RAND *rand);
@@ -83,7 +83,7 @@ RAND and RAND_DRBG functions.
After creating a B<EVP_RAND_CTX> for the required algorithm using
EVP_RAND_CTX_new(), inputs to the algorithm are supplied either by
passing them as part of the EVP_RAND_instantiate() call or using calls to
-EVP_RAND_set_ctx_params() before calling EVP_RAND_instantiate(). Finally,
+EVP_RAND_CTX_set_params() before calling EVP_RAND_instantiate(). Finally,
call EVP_RAND_generate() to produce cryptographically secure random bytes.
=head2 Types
@@ -170,14 +170,14 @@ parameters should be retrieved.
Note that a parameter that is unknown in the underlying context is
simply ignored.
-EVP_RAND_get_ctx_params() retrieves chosen parameters, given the
+EVP_RAND_CTX_get_params() retrieves chosen parameters, given the
context I<ctx> and its underlying context.
The set of parameters given with I<params> determine exactly what
parameters should be retrieved.
Note that a parameter that is unknown in the underlying context is
simply ignored.
-EVP_RAND_set_ctx_params() passes chosen parameters to the underlying
+EVP_RAND_CTX_set_params() passes chosen parameters to the underlying
context, given a context I<ctx>.
The set of parameters given with I<params> determine exactly what
parameters are passed down.
diff --git a/doc/man7/life_cycle-rand.pod b/doc/man7/life_cycle-rand.pod
index b78b8484d2..5b3e81caa9 100644
--- a/doc/man7/life_cycle-rand.pod
+++ b/doc/man7/life_cycle-rand.pod
@@ -92,8 +92,8 @@ This is the canonical list.
EVP_RAND_generate instantiated
EVP_RAND_uninstantiate uninstantiated
EVP_RAND_CTX_free freed freed freed freed
- EVP_RAND_get_ctx_params newed instantiated uninstantiated freed
- EVP_RAND_set_ctx_params newed instantiated uninstantiated freed
+ EVP_RAND_CTX_get_params newed instantiated uninstantiated freed
+ EVP_RAND_CTX_set_params newed instantiated uninstantiated freed
EVP_RAND_CTX_gettable_params newed instantiated uninstantiated freed
EVP_RAND_CTX_settable_params newed instantiated uninstantiated freed
@@ -140,13 +140,13 @@ This is the canonical list.
<td style="border:1px solid" align="center">freed</td>
<td style="border:1px solid" align="center">freed</td>
<td style="border:1px solid" align="center"></td></tr>
-<tr><th style="border:1px solid" align="left">EVP_RAND_get_ctx_params</th>
+<tr><th style="border:1px solid" align="left">EVP_RAND_CTX_get_params</th>
<td style="border:1px solid" align="center"></td>
<td style="border:1px solid" align="center">newed</td>
<td style="border:1px solid" align="center">instantiated</td>
<td style="border:1px solid" align="center">uninstantiated</td>
<td style="border:1px solid" align="center"></td></tr>
-<tr><th style="border:1px solid" align="left">EVP_RAND_set_ctx_params</th>
+<tr><th style="border:1px solid" align="left">EVP_RAND_CTX_set_params</th>
<td style="border:1px solid" align="center"></td>
<td style="border:1px solid" align="center">newed</td>
<td style="border:1px solid" align="center">instantiated</td>
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index 35cdfe1c05..6fd895a221 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -1199,8 +1199,8 @@ int EVP_RAND_get_params(EVP_RAND *rand, OSSL_PARAM params[]);
EVP_RAND_CTX *EVP_RAND_CTX_new(EVP_RAND *rand, EVP_RAND_CTX *parent);
void EVP_RAND_CTX_free(EVP_RAND_CTX *ctx);
EVP_RAND *EVP_RAND_CTX_rand(EVP_RAND_CTX *ctx);
-int EVP_RAND_get_ctx_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]);
-int EVP_RAND_set_ctx_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]);
+int EVP_RAND_CTX_get_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]);
+int EVP_RAND_CTX_set_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]);
const OSSL_PARAM *EVP_RAND_gettable_params(const EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_gettable_ctx_params(const EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_settable_ctx_params(const EVP_RAND *rand);
diff --git a/providers/fips/self_test_kats.c b/providers/fips/self_test_kats.c
index 0041a88842..1b89cc82ae 100644
--- a/providers/fips/self_test_kats.c
+++ b/providers/fips/self_test_kats.c
@@ -273,7 +273,7 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,
drbg_params[0] = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH,
&strength);
- if (!EVP_RAND_set_ctx_params(test, drbg_params))
+ if (!EVP_RAND_CTX_set_params(test, drbg_params))
goto err;
rand = EVP_RAND_fetch(libctx, t->algorithm, NULL);
@@ -292,7 +292,7 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,
/* This is only used by HMAC-DRBG but it is ignored by the others */
drbg_params[1] =
OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_MAC, "HMAC", 0);
- if (!EVP_RAND_set_ctx_params(drbg, drbg_params))
+ if (!EVP_RAND_CTX_set_params(drbg, drbg_params))
goto err;
drbg_params[0] =
@@ -312,7 +312,7 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,
OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY,
(void *)t->entropyinpr1,
t->entropyinpr1len);
- if (!EVP_RAND_set_ctx_params(test, drbg_params))
+ if (!EVP_RAND_CTX_set_params(test, drbg_params))
goto err;
if (!EVP_RAND_generate(drbg, out, t->expectedlen, strength,
@@ -324,7 +324,7 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,
OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY,
(void *)t->entropyinpr2,
t->entropyinpr2len);
- if (!EVP_RAND_set_ctx_params(test, drbg_params))
+ if (!EVP_RAND_CTX_set_params(test, drbg_params))
goto err;
/*
diff --git a/test/acvp_test.c b/test/acvp_test.c
index daa2e6843a..c2b024da01 100644
--- a/test/acvp_test.c
+++ b/test/acvp_test.c
@@ -1351,7 +1351,7 @@ static int drbg_test(int id)
params[0] = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH, &strength);
params[1] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(parent, params)))
goto err;
/* Get the DRBG */
@@ -1365,7 +1365,7 @@ static int drbg_test(int id)
params[1] = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
(char *)tst->cipher, 0);
params[2] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(ctx, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(ctx, params)))
goto err;
/* Feed in the entropy and nonce */
@@ -1376,7 +1376,7 @@ static int drbg_test(int id)
(void *)tst->nonce,
tst->nonce_len);
params[2] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(parent, params)))
goto err;
/*
diff --git a/test/drbgtest.c b/test/drbgtest.c
index 07f123dce8..70e062ce75 100644
--- a/test/drbgtest.c
+++ b/test/drbgtest.c
@@ -90,7 +90,7 @@ static unsigned int query_rand_uint(EVP_RAND_CTX *drbg, const char *name)
unsigned int n;
*params = OSSL_PARAM_construct_uint(name, &n);
- if (EVP_RAND_get_ctx_params(drbg, params))
+ if (EVP_RAND_CTX_get_params(drbg, params))
return n;
return 0;
}
@@ -125,7 +125,7 @@ static time_t reseed_time(EVP_RAND_CTX *drbg)
time_t t;
*params = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME, &t);
- if (EVP_RAND_get_ctx_params(drbg, params))
+ if (EVP_RAND_CTX_get_params(drbg, params))
return t;
return 0;
}
@@ -691,7 +691,7 @@ static int set_reseed_time_interval(EVP_RAND_CTX *drbg, int t)
params[0] = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
&t);
params[1] = OSSL_PARAM_construct_end();
- return EVP_RAND_set_ctx_params(drbg, params);
+ return EVP_RAND_CTX_set_params(drbg, params);
}
static void run_multi_thread_test(void)
@@ -808,7 +808,7 @@ static EVP_RAND_CTX *new_drbg(EVP_RAND_CTX *parent)
if (!TEST_ptr(rand = EVP_RAND_fetch(NULL, "CTR-DRBG", NULL))
|| !TEST_ptr(drbg = EVP_RAND_CTX_new(rand, parent))
- || !TEST_true(EVP_RAND_set_ctx_params(drbg, params))) {
+ || !TEST_true(EVP_RAND_CTX_set_params(drbg, params))) {
EVP_RAND_CTX_free(drbg);
drbg = NULL;
}
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index afba7ea75b..24eff86c5d 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -2416,7 +2416,7 @@ static int test_rand_agglomeration(void)
seed, sizeof(seed));
*p++ = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_MAX_REQUEST, &step);
*p = OSSL_PARAM_construct_end();
- res = TEST_true(EVP_RAND_set_ctx_params(ctx, params))
+ res = TEST_true(EVP_RAND_CTX_set_params(ctx, params))
&& TEST_true(EVP_RAND_generate(ctx, out, sizeof(out), 0, 1, NULL, 0))
&& TEST_mem_eq(seed, sizeof(seed), out, sizeof(out));
EVP_RAND_CTX_free(ctx);
diff --git a/test/evp_test.c b/test/evp_test.c
index 503aaa0e8e..08341e4617 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -2117,7 +2117,7 @@ static int rand_test_init(EVP_TEST *t, const char *name)
goto err;
*params = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH, &strength);
- if (!EVP_RAND_set_ctx_params(rdata->parent, params))
+ if (!EVP_RAND_CTX_set_params(rdata->parent, params))
goto err;
rand = EVP_RAND_fetch(libctx, name, NULL);
@@ -2250,7 +2250,7 @@ static int rand_test_run(EVP_TEST *t)
expected->digest, 0);
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_MAC, "HMAC", 0);
*p = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(expected->ctx, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(expected->ctx, params)))
goto err;
strength = EVP_RAND_strength(expected->ctx);
@@ -2281,7 +2281,7 @@ static int rand_test_run(EVP_TEST *t)
(OSSL_RAND_PARAM_TEST_ENTROPY, item->reseed_entropy,
item->reseed_entropy_len);
params[1] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(expected->parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(expected->parent, params)))
goto err;
if (!TEST_true(EVP_RAND_reseed
@@ -2295,7 +2295,7 @@ static int rand_test_run(EVP_TEST *t)
(OSSL_RAND_PARAM_TEST_ENTROPY, item->pr_entropyA,
item->pr_entropyA_len);
params[1] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(expected->parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(expected->parent, params)))
goto err;
}
if (!TEST_true(EVP_RAND_generate
@@ -2309,7 +2309,7 @@ static int rand_test_run(EVP_TEST *t)
(OSSL_RAND_PARAM_TEST_ENTROPY, item->pr_entropyB,
item->pr_entropyB_len);
params[1] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(expected->parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(expected->parent, params)))
return 0;
}
if (!TEST_true(EVP_RAND_generate
diff --git a/util/libcrypto.num b/util/libcrypto.num
index 2350438478..bf208e8414 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -5043,8 +5043,8 @@ EVP_RAND_get_params ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_CTX_new ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_CTX_free ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_CTX_rand ? 3_0_0 EXIST::FUNCTION:
-EVP_RAND_get_ctx_params ? 3_0_0 EXIST::FUNCTION:
-EVP_RAND_set_ctx_params ? 3_0_0 EXIST::FUNCTION:
+EVP_RAND_CTX_get_params ? 3_0_0 EXIST::FUNCTION:
+EVP_RAND_CTX_set_params ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_gettable_params ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_gettable_ctx_params ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_settable_ctx_params ? 3_0_0 EXIST::FUNCTION:
More information about the openssl-commits
mailing list