From a3f091fddd1f5349a14f3874d0e3a6d77cba9865 Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 23 Feb 2021 09:51:10 +1000 Subject: [PATCH] prov: update RNGs to support modified gettable/settable CTX params Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14240) --- providers/implementations/rands/drbg_ctr.c | 6 ++++-- providers/implementations/rands/drbg_hash.c | 6 ++++-- providers/implementations/rands/drbg_hmac.c | 6 ++++-- providers/implementations/rands/seed_src.c | 3 ++- providers/implementations/rands/test_rng.c | 6 ++++-- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/providers/implementations/rands/drbg_ctr.c b/providers/implementations/rands/drbg_ctr.c index e10b4378b5..066775aa52 100644 --- a/providers/implementations/rands/drbg_ctr.c +++ b/providers/implementations/rands/drbg_ctr.c @@ -648,7 +648,8 @@ static int drbg_ctr_get_ctx_params(void *vdrbg, OSSL_PARAM params[]) return ossl_drbg_get_ctx_params(drbg, params); } -static const OSSL_PARAM *drbg_ctr_gettable_ctx_params(ossl_unused void *provctx) +static const OSSL_PARAM *drbg_ctr_gettable_ctx_params(ossl_unused void *vctx, + ossl_unused void *provctx) { static const OSSL_PARAM known_gettable_ctx_params[] = { OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_CIPHER, NULL, 0), @@ -718,7 +719,8 @@ static int drbg_ctr_set_ctx_params(void *vctx, const OSSL_PARAM params[]) return ossl_drbg_set_ctx_params(ctx, params); } -static const OSSL_PARAM *drbg_ctr_settable_ctx_params(ossl_unused void *provctx) +static const OSSL_PARAM *drbg_ctr_settable_ctx_params(ossl_unused void *vctx, + ossl_unused void *provctx) { static const OSSL_PARAM known_settable_ctx_params[] = { OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0), diff --git a/providers/implementations/rands/drbg_hash.c b/providers/implementations/rands/drbg_hash.c index a181b8f97e..c89b0cd5c3 100644 --- a/providers/implementations/rands/drbg_hash.c +++ b/providers/implementations/rands/drbg_hash.c @@ -442,7 +442,8 @@ static int drbg_hash_get_ctx_params(void *vdrbg, OSSL_PARAM params[]) return ossl_drbg_get_ctx_params(drbg, params); } -static const OSSL_PARAM *drbg_hash_gettable_ctx_params(ossl_unused void *p_ctx) +static const OSSL_PARAM *drbg_hash_gettable_ctx_params(ossl_unused void *vctx, + ossl_unused void *p_ctx) { static const OSSL_PARAM known_gettable_ctx_params[] = { OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_DIGEST, NULL, 0), @@ -487,7 +488,8 @@ static int drbg_hash_set_ctx_params(void *vctx, const OSSL_PARAM params[]) return ossl_drbg_set_ctx_params(ctx, params); } -static const OSSL_PARAM *drbg_hash_settable_ctx_params(ossl_unused void *p_ctx) +static const OSSL_PARAM *drbg_hash_settable_ctx_params(ossl_unused void *vctx, + ossl_unused void *p_ctx) { static const OSSL_PARAM known_settable_ctx_params[] = { OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0), diff --git a/providers/implementations/rands/drbg_hmac.c b/providers/implementations/rands/drbg_hmac.c index 16c5ae8711..5f193fa57c 100644 --- a/providers/implementations/rands/drbg_hmac.c +++ b/providers/implementations/rands/drbg_hmac.c @@ -349,7 +349,8 @@ static int drbg_hmac_get_ctx_params(void *vdrbg, OSSL_PARAM params[]) return ossl_drbg_get_ctx_params(drbg, params); } -static const OSSL_PARAM *drbg_hmac_gettable_ctx_params(ossl_unused void *p_ctx) +static const OSSL_PARAM *drbg_hmac_gettable_ctx_params(ossl_unused void *vctx, + ossl_unused void *p_ctx) { static const OSSL_PARAM known_gettable_ctx_params[] = { OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_MAC, NULL, 0), @@ -400,7 +401,8 @@ static int drbg_hmac_set_ctx_params(void *vctx, const OSSL_PARAM params[]) return ossl_drbg_set_ctx_params(ctx, params); } -static const OSSL_PARAM *drbg_hmac_settable_ctx_params(ossl_unused void *p_ctx) +static const OSSL_PARAM *drbg_hmac_settable_ctx_params(ossl_unused void *vctx, + ossl_unused void *p_ctx) { static const OSSL_PARAM known_settable_ctx_params[] = { OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0), diff --git a/providers/implementations/rands/seed_src.c b/providers/implementations/rands/seed_src.c index 06364b9074..b87aa0c6cd 100644 --- a/providers/implementations/rands/seed_src.c +++ b/providers/implementations/rands/seed_src.c @@ -156,7 +156,8 @@ static int seed_src_get_ctx_params(void *vseed, OSSL_PARAM params[]) return 1; } -static const OSSL_PARAM *seed_src_gettable_ctx_params(ossl_unused void *provctx) +static const OSSL_PARAM *seed_src_gettable_ctx_params(ossl_unused void *vseed, + ossl_unused void *provctx) { static const OSSL_PARAM known_gettable_ctx_params[] = { OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL), diff --git a/providers/implementations/rands/test_rng.c b/providers/implementations/rands/test_rng.c index a1b847ee78..d28f7e0937 100644 --- a/providers/implementations/rands/test_rng.c +++ b/providers/implementations/rands/test_rng.c @@ -163,7 +163,8 @@ static int test_rng_get_ctx_params(void *vtest, OSSL_PARAM params[]) return 1; } -static const OSSL_PARAM *test_rng_gettable_ctx_params(ossl_unused void *provctx) +static const OSSL_PARAM *test_rng_gettable_ctx_params(ossl_unused void *vtest, + ossl_unused void *provctx) { static const OSSL_PARAM known_gettable_ctx_params[] = { OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL), @@ -212,7 +213,8 @@ static int test_rng_set_ctx_params(void *vtest, const OSSL_PARAM params[]) return 1; } -static const OSSL_PARAM *test_rng_settable_ctx_params(ossl_unused void *provctx) +static const OSSL_PARAM *test_rng_settable_ctx_params(ossl_unused void *vtest, + ossl_unused void *provctx) { static const OSSL_PARAM known_settable_ctx_params[] = { OSSL_PARAM_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY, NULL, 0),