summaryrefslogtreecommitdiffstats
path: root/test/cmp_vfy_test.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-08-12 20:24:26 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-08-21 09:04:09 +0200
commit06cee80a843cae6bcb2dcba7eab26c963e10f825 (patch)
treeef5df87115cca88e27ee82d0ce2c57ba7757e1c4 /test/cmp_vfy_test.c
parentCorrect the #define's of EVP_PKEY_CTRL_SET1_ID and EVP_PKEY_CTRL_GET1_ID{,_LEN} (diff)
downloadopenssl-06cee80a843cae6bcb2dcba7eab26c963e10f825.tar.xz
openssl-06cee80a843cae6bcb2dcba7eab26c963e10f825.zip
testutil: Make SETUP_TEST_FIXTURE return 0 on fixture == NULL
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11808)
Diffstat (limited to 'test/cmp_vfy_test.c')
-rw-r--r--test/cmp_vfy_test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/cmp_vfy_test.c b/test/cmp_vfy_test.c
index fcecca2500..4c705f62c8 100644
--- a/test/cmp_vfy_test.c
+++ b/test/cmp_vfy_test.c
@@ -140,13 +140,14 @@ static int execute_validate_cert_path_test(CMP_VFY_TEST_FIXTURE *fixture)
static int test_validate_msg_mac_alg_protection(void)
{
- SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
/* secret value belonging to cmp-test/CMP_IP_waitingStatus_PBM.der */
const unsigned char sec_1[] = {
'9', 'p', 'p', '8', '-', 'b', '3', '5', 'i', '-', 'X', 'd', '3',
'Q', '-', 'u', 'd', 'N', 'R'
};
+ SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
+
fixture->expected = 1;
if (!TEST_true(OSSL_CMP_CTX_set1_secretValue(fixture->cmp_ctx, sec_1,
sizeof(sec_1)))
@@ -161,11 +162,12 @@ static int test_validate_msg_mac_alg_protection(void)
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
static int test_validate_msg_mac_alg_protection_bad(void)
{
- SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
const unsigned char sec_bad[] = {
'9', 'p', 'p', '8', '-', 'b', '3', '5', 'i', '-', 'X', 'd', '3',
'Q', '-', 'u', 'd', 'N', 'r'
};
+
+ SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
fixture->expected = 0;
if (!TEST_true(OSSL_CMP_CTX_set1_secretValue(fixture->cmp_ctx, sec_bad,
@@ -192,9 +194,11 @@ static int add_untrusted(OSSL_CMP_CTX *ctx, X509 *cert)
static int test_validate_msg_signature_partial_chain(int expired)
{
+ X509_STORE *ts;
+
SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
- X509_STORE *ts = OSSL_CMP_CTX_get0_trustedStore(fixture->cmp_ctx);
+ ts = OSSL_CMP_CTX_get0_trustedStore(fixture->cmp_ctx);
fixture->expected = !expired;
if (ts == NULL
|| !TEST_ptr(fixture->msg = load_pkimsg(ir_protected_f))