Skip to content

Commit

Permalink
Test that NULL BIGNUM is supported in OSSL_PARAM_BLD_push_BN()
Browse files Browse the repository at this point in the history
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Matt Caswell <[email protected]>
(Merged from openssl#21945)
  • Loading branch information
t8m committed Sep 5, 2023
1 parent 2ce79d9 commit a535e5b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/param_build_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

static const OSSL_PARAM params_empty[] = { OSSL_PARAM_END };

static int template_public_single_zero_test(void)
static int template_public_single_zero_test(int idx)
{
OSSL_PARAM_BLD *bld = NULL;
OSSL_PARAM *params = NULL, *params_blt = NULL, *p;
Expand All @@ -25,7 +25,8 @@ static int template_public_single_zero_test(void)

if (!TEST_ptr(bld = OSSL_PARAM_BLD_new())
|| !TEST_ptr(zbn = BN_new())
|| !TEST_true(OSSL_PARAM_BLD_push_BN(bld, "zeronumber", zbn))
|| !TEST_true(OSSL_PARAM_BLD_push_BN(bld, "zeronumber",
idx == 0 ? zbn : NULL))
|| !TEST_ptr(params_blt = OSSL_PARAM_BLD_to_param(bld)))
goto err;

Expand Down Expand Up @@ -550,7 +551,7 @@ static int builder_merge_test(void)

int setup_tests(void)
{
ADD_TEST(template_public_single_zero_test);
ADD_ALL_TESTS(template_public_single_zero_test, 2);
ADD_ALL_TESTS(template_public_test, 5);
/* Only run the secure memory testing if we have secure memory available */
if (CRYPTO_secure_malloc_init(1<<16, 16)) {
Expand Down

0 comments on commit a535e5b

Please sign in to comment.