From: Čestmír Kalina Date: Thu, 8 Dec 2022 15:49:56 +0000 (+0100) Subject: test: cmp_vfy_test: fix defined but unused X-Git-Tag: openssl-3.2.0-alpha1~1587 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=97446da7e05bd7164f5c36b68b8bef13a63e06a5;p=thirdparty%2Fopenssl.git 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 Reviewed-by: Tomas Mraz Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/19868) --- diff --git a/test/cmp_vfy_test.c b/test/cmp_vfy_test.c index d4fe21e694e..383ac2c852e 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) {