summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-04-20 17:19:50 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-04-21 07:58:55 +0200
commit78b4aba9f814e7866bc47a4b6552fb3b2b992cfa (patch)
tree49bb1f949cc90c2a8e0f2d7c1fef48584960a943
parent7a92e804696fec77b9c07f03fbdf74a60b30e47a (diff)
Fix test_cmp_vfy failures with FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
[extended tests] Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/11585)
-rw-r--r--test/cmp_vfy_test.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/cmp_vfy_test.c b/test/cmp_vfy_test.c
index 9fca675ef1..e2dd80bef7 100644
--- a/test/cmp_vfy_test.c
+++ b/test/cmp_vfy_test.c
@@ -109,6 +109,7 @@ static int test_verify_popo(void)
return result;
}
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
static int test_verify_popo_bad(void)
{
SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
@@ -116,6 +117,7 @@ static int test_verify_popo_bad(void)
EXECUTE_TEST(execute_verify_popo_test, tear_down);
return result;
}
+#endif
static int execute_validate_msg_test(CMP_VFY_TEST_FIXTURE *fixture)
{
@@ -444,6 +446,7 @@ static void setup_check_received(CMP_VFY_TEST_FIXTURE **fixture, int expected,
}
}
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
static int test_MSG_check_received_no_protection_no_cb(void)
{
SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
@@ -459,6 +462,7 @@ static int test_MSG_check_received_no_protection_restrictive_cb(void)
EXECUTE_TEST(execute_MSG_check_received_test, tear_down);
return result;
}
+#endif
static int test_MSG_check_received_no_protection_permissive_cb(void)
{
@@ -484,6 +488,7 @@ static int test_MSG_check_received_check_transaction_id(void)
return result;
}
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
static int test_MSG_check_received_check_transaction_id_bad(void)
{
SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
@@ -491,6 +496,7 @@ static int test_MSG_check_received_check_transaction_id_bad(void)
EXECUTE_TEST(execute_MSG_check_received_test, tear_down);
return result;
}
+#endif
static int test_MSG_check_received_check_recipient_nonce(void)
{
@@ -507,6 +513,7 @@ static int test_MSG_check_received_check_recipient_nonce(void)
return result;
}
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
static int test_MSG_check_received_check_recipient_nonce_bad(void)
{
SETUP_TEST_FIXTURE(CMP_VFY_TEST_FIXTURE, set_up);
@@ -514,6 +521,7 @@ static int test_MSG_check_received_check_recipient_nonce_bad(void)
EXECUTE_TEST(execute_MSG_check_received_test, tear_down);
return result;
}
+#endif
void cleanup_tests(void)
{
@@ -596,7 +604,9 @@ int setup_tests(void)
/* Message validation tests */
ADD_TEST(test_verify_popo);
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
ADD_TEST(test_verify_popo_bad);
+#endif
ADD_TEST(test_validate_msg_signature_trusted_ok);
ADD_TEST(test_validate_msg_signature_trusted_expired);
ADD_TEST(test_validate_msg_signature_srvcert_wrong);
@@ -617,13 +627,19 @@ int setup_tests(void)
ADD_TEST(test_validate_cert_path_expired);
ADD_TEST(test_validate_cert_path_wrong_anchor);
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
ADD_TEST(test_MSG_check_received_no_protection_no_cb);
ADD_TEST(test_MSG_check_received_no_protection_restrictive_cb);
+#endif
ADD_TEST(test_MSG_check_received_no_protection_permissive_cb);
ADD_TEST(test_MSG_check_received_check_transaction_id);
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
ADD_TEST(test_MSG_check_received_check_transaction_id_bad);
+#endif
ADD_TEST(test_MSG_check_received_check_recipient_nonce);
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
ADD_TEST(test_MSG_check_received_check_recipient_nonce_bad);
+#endif
return 1;