summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2023-09-04 09:09:40 +0200
committerTomas Mraz <tomas@openssl.org>2023-09-05 12:50:39 +0200
commita535e5b73fc374dbbef54d2629728e9602ecf6be (patch)
tree29d17c410b8d92ad7a5e2b86738b3bfa0b14d140 /test
parent2ce79d97e338c8eaacf67ce2e1a1b0fb1c639f11 (diff)
Test that NULL BIGNUM is supported in OSSL_PARAM_BLD_push_BN()
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21945)
Diffstat (limited to 'test')
-rw-r--r--test/param_build_test.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/param_build_test.c b/test/param_build_test.c
index d67df3c311..68517e66be 100644
--- a/test/param_build_test.c
+++ b/test/param_build_test.c
@@ -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;
@@ -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;
@@ -550,7 +551,7 @@ err:
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)) {