Skip to content

Commit 9efcb7b

Browse files
committed
tests: guard DsaSign_ex / DhGenerateParams tests for the frozen selftest API
The CAVP-selftest-v2 CI leg configures with --enable-dsa --enable-keygen (richer than the minimal selftest profile), so it compiles two more functions that call wolfCrypt APIs absent from the frozen v4.1.0 module: - test_wc_DsaSign_bad_digestSz -> wc_DsaSign_ex / wc_DsaVerify_ex - test_wc_DhGenerateParams_and_ExportRaw -> wc_DhGenerateParams / wc_DhExportParamsRaw Exclude both from HAVE_SELFTEST / HAVE_FIPS builds. Only a frozen build run under the CAVP config (DSA + keygen on) exposes these.
1 parent b2bc245 commit 9efcb7b

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

tests/api/test_dh.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,8 @@ int test_wc_DhGenerateParams_and_ExportRaw(void)
956956
* domain parameters (wc_DhGenerateParams returns PRIME_GEN_E), so the
957957
* generate-and-export flow below is only valid with the full SP math
958958
* (WOLFSSL_SP_MATH_ALL), fastmath or heapmath backends. */
959-
#if !defined(NO_DH) && defined(WOLFSSL_KEY_GEN) && !defined(WOLFSSL_SP_MATH)
959+
#if !defined(NO_DH) && defined(WOLFSSL_KEY_GEN) && !defined(WOLFSSL_SP_MATH) && \
960+
!defined(HAVE_SELFTEST) && !defined(HAVE_FIPS)
960961
DhKey dh;
961962
WC_RNG rng;
962963
/* g is found by an unbounded incrementing search (wc_DhGenerateParams),

tests/api/test_dsa.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,8 @@ static void dsa_test_fill_hex(char* dst, int len)
759759
int test_wc_DsaSign_bad_digestSz(void)
760760
{
761761
EXPECT_DECLS;
762-
#if !defined(NO_DSA) && !defined(WC_FIPS_186_5_PLUS)
762+
#if !defined(NO_DSA) && !defined(WC_FIPS_186_5_PLUS) && \
763+
!defined(HAVE_SELFTEST) && !defined(HAVE_FIPS)
763764
DsaKey key;
764765
WC_RNG rng;
765766
byte signature[DSA_SIG_SIZE];

0 commit comments

Comments
 (0)