]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test: cmp_vfy_test: fix defined but unused
authorČestmír Kalina <ckalina@redhat.com>
Thu, 8 Dec 2022 15:49:56 +0000 (16:49 +0100)
committerHugo Landau <hlandau@openssl.org>
Wed, 14 Dec 2022 09:21:19 +0000 (09:21 +0000)
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)

test/cmp_vfy_test.c

index d4fe21e694efe8e0e507801181216a6ac77cb7e1..383ac2c852ed8226700102389fab9aac38f28697 100644 (file)
@@ -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)
 {