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)
This commit is contained in:
Čestmír Kalina 2022-12-08 16:49:56 +01:00 committed by Hugo Landau
parent abdf35158e
commit 97446da7e0

View 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)
{