test: update tests to allow for params argument for the instantiate call on EVP_RAND_CTXs

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14310)
This commit is contained in:
Pauli 2021-02-26 10:56:17 +10:00
parent b98d550d80
commit 7198bd1a8f
3 changed files with 7 additions and 8 deletions

View File

@ -1383,7 +1383,7 @@ static int drbg_test(int id)
* A NULL personalisation string defaults to the built in so something
* non-NULL is needed if there is no personalisation string
*/
if (!TEST_true(EVP_RAND_instantiate(ctx, 0, 0, (void *)"", 0))
if (!TEST_true(EVP_RAND_instantiate(ctx, 0, 0, (void *)"", 0, NULL))
|| !TEST_true(EVP_RAND_generate(ctx, returned_bits, returned_bits_len,
0, 0, NULL, 0))
|| !TEST_true(EVP_RAND_generate(ctx, returned_bits, returned_bits_len,

View File

@ -828,11 +828,11 @@ static int test_rand_prediction_resistance(void)
/* Initialise a three long DRBG chain */
if (!TEST_ptr(x = new_drbg(NULL))
|| !TEST_true(disable_crngt(x))
|| !TEST_true(EVP_RAND_instantiate(x, 0, 0, NULL, 0))
|| !TEST_true(EVP_RAND_instantiate(x, 0, 0, NULL, 0, NULL))
|| !TEST_ptr(y = new_drbg(x))
|| !TEST_true(EVP_RAND_instantiate(y, 0, 0, NULL, 0))
|| !TEST_true(EVP_RAND_instantiate(y, 0, 0, NULL, 0, NULL))
|| !TEST_ptr(z = new_drbg(y))
|| !TEST_true(EVP_RAND_instantiate(z, 0, 0, NULL, 0)))
|| !TEST_true(EVP_RAND_instantiate(z, 0, 0, NULL, 0, NULL)))
goto err;
/*

View File

@ -2259,16 +2259,15 @@ static int rand_test_run(EVP_TEST *t)
*p++ = OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_NONCE,
z, item->nonce_len);
*p = OSSL_PARAM_construct_end();
if (!TEST_true(EVP_RAND_set_ctx_params(expected->parent, params))
|| !TEST_true(EVP_RAND_instantiate(expected->parent, strength,
0, NULL, 0)))
if (!TEST_true(EVP_RAND_instantiate(expected->parent, strength,
0, NULL, 0, params)))
goto err;
z = item->pers != NULL ? item->pers : (unsigned char *)"";
if (!TEST_true(EVP_RAND_instantiate
(expected->ctx, strength,
expected->prediction_resistance, z,
item->pers_len)))
item->pers_len, NULL)))
goto err;
if (item->reseed_entropy != NULL) {