ML-DSA: fix tests for different configs

Setting the private key into SSL object requires signing to be
available.
Only enable the parameters that are compiled in.
pull/8865/head
Sean Parkinson 2025-06-10 20:44:27 +10:00
parent 106bcb22d3
commit cb90b78688
2 changed files with 9 additions and 0 deletions

View File

@ -16665,6 +16665,7 @@ int test_mldsa_pkcs8(void)
defined(HAVE_DILITHIUM) && !defined(NO_TLS) && \
(!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
!defined(WOLFSSL_DILITHIUM_NO_MAKE_KEY) && \
!defined(WOLFSSL_DILITHIUM_NO_SIGN) && \
!defined(WOLFSSL_DILITHIUM_NO_ASN1)
WOLFSSL_CTX* ctx = NULL;
@ -16685,9 +16686,15 @@ int test_mldsa_pkcs8(void)
int oidSum;
int keySz;
} test_variant[] = {
#ifndef WOLFSSL_NO_ML_DSA_44
{WC_ML_DSA_44, ML_DSA_LEVEL2k, ML_DSA_LEVEL2_PRV_KEY_SIZE},
#endif
#ifndef WOLFSSL_NO_ML_DSA_65
{WC_ML_DSA_65, ML_DSA_LEVEL3k, ML_DSA_LEVEL3_PRV_KEY_SIZE},
#endif
#ifndef WOLFSSL_NO_ML_DSA_87
{WC_ML_DSA_87, ML_DSA_LEVEL5k, ML_DSA_LEVEL5_PRV_KEY_SIZE}
#endif
};
(void) pemSz;

View File

@ -46814,8 +46814,10 @@ static wc_test_ret_t dilithium_param_test(int param, WC_RNG* rng)
byte* sig = NULL;
#else
dilithium_key key[1];
#ifndef WOLFSSL_DILITHIUM_NO_SIGN
byte sig[DILITHIUM_MAX_SIG_SIZE];
#endif
#endif
#ifndef WOLFSSL_DILITHIUM_NO_SIGN
word32 sigLen;
byte msg[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };