From 20b8dc6fb1964ca16b85799b25c5f46d23b1a7cb Mon Sep 17 00:00:00 2001 From: Pauli Date: Wed, 10 Mar 2021 18:38:04 +1000 Subject: update set_ctx_param DRBG calls to return 1 for a NULL params Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/14383) --- providers/implementations/rands/drbg.c | 3 +++ providers/implementations/rands/test_rng.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'providers/implementations/rands') diff --git a/providers/implementations/rands/drbg.c b/providers/implementations/rands/drbg.c index a05c9397c8..461d641273 100644 --- a/providers/implementations/rands/drbg.c +++ b/providers/implementations/rands/drbg.c @@ -915,6 +915,9 @@ int ossl_drbg_set_ctx_params(PROV_DRBG *drbg, const OSSL_PARAM params[]) { const OSSL_PARAM *p; + if (params == NULL) + return 1; + p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_RESEED_REQUESTS); if (p != NULL && !OSSL_PARAM_get_uint(p, &drbg->reseed_interval)) return 0; diff --git a/providers/implementations/rands/test_rng.c b/providers/implementations/rands/test_rng.c index 1335de8681..bdad7ac9ac 100644 --- a/providers/implementations/rands/test_rng.c +++ b/providers/implementations/rands/test_rng.c @@ -183,6 +183,9 @@ static int test_rng_set_ctx_params(void *vtest, const OSSL_PARAM params[]) void *ptr = NULL; size_t size = 0; + if (params == NULL) + return 1; + p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_STRENGTH); if (p != NULL && !OSSL_PARAM_get_uint(p, &t->strength)) return 0; -- cgit v1.2.3