aboutsummaryrefslogtreecommitdiff
path: root/test/cmp_vfy_test.c
diff options
context:
space:
mode:
authorČestmír Kalina <ckalina@redhat.com>2022-12-08 16:49:56 +0100
committerHugo Landau <hlandau@openssl.org>2022-12-14 09:21:19 +0000
commit97446da7e05bd7164f5c36b68b8bef13a63e06a5 (patch)
tree110810758883613efae7f0ebc98e9273fe549acd /test/cmp_vfy_test.c
parentabdf35158e4398deedcf160c28bd07c7080edf47 (diff)
downloadopenssl-97446da7e05bd7164f5c36b68b8bef13a63e06a5.zip
openssl-97446da7e05bd7164f5c36b68b8bef13a63e06a5.tar.gz
openssl-97446da7e05bd7164f5c36b68b8bef13a63e06a5.tar.bz2
test: cmp_vfy_test: fix defined but unused
Building with ./config -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION \ -DPEDANTIC -Wall -Werror -pedantic fails since the following test cases are excluded when FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is defined: - test_validate_msg_signature_srvcert_missing - test_validate_msg_mac_alg_protection_wrong - test_validate_msg_mac_alg_protection_missing Guard the test cases by the corresponding preprocessor conditionals. Signed-off-by: Čestmír Kalina <ckalina@redhat.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19868)
Diffstat (limited to 'test/cmp_vfy_test.c')
-rw-r--r--test/cmp_vfy_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/cmp_vfy_test.c b/test/cmp_vfy_test.c
index d4fe21e..383ac2c 100644
--- a/test/cmp_vfy_test.c
+++ b/test/cmp_vfy_test.c
@@ -175,6 +175,7 @@ static int test_validate_msg_mac_alg_protection_ok(void)
return test_validate_msg_mac_alg_protection(0, 0);
}
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
static int test_validate_msg_mac_alg_protection_missing(void)
{
return test_validate_msg_mac_alg_protection(1, 0);
@@ -185,7 +186,6 @@ static int test_validate_msg_mac_alg_protection_wrong(void)
return test_validate_msg_mac_alg_protection(0, 1);
}
-#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
static int test_validate_msg_mac_alg_protection_bad(void)
{
const unsigned char sec_bad[] = {
@@ -274,10 +274,12 @@ static int test_validate_msg_signature_srvcert(int bad_sig, int miss, int wrong)
return result;
}
+#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
static int test_validate_msg_signature_srvcert_missing(void)
{
return test_validate_msg_signature_srvcert(0, 1, 0);
}
+#endif
static int test_validate_msg_signature_srvcert_wrong(void)
{