@@ -37899,7 +37899,11 @@ static int test_lms_init_key(LmsKey* key, WC_RNG* rng)
3789937899 ret = wc_LmsKey_Init(key, NULL, INVALID_DEVID);
3790037900 if (ret != 0) return ret;
3790137901
37902+ #if !defined(WOLFSSL_LMS_MAX_HEIGHT) || (WOLFSSL_LMS_MAX_HEIGHT >= 10)
3790237903 ret = wc_LmsKey_SetParameters(key, 1, 10, 8);
37904+ #else
37905+ ret = wc_LmsKey_SetParameters(key, 1, 5, 8);
37906+ #endif
3790337907 if (ret != 0) return ret;
3790437908
3790537909 ret = wc_LmsKey_SetWriteCb(key, test_lms_write_key);
@@ -37973,7 +37977,8 @@ int test_wc_LmsKey_sign_verify(void)
3797337977int test_wc_LmsKey_reload_cache(void)
3797437978{
3797537979 EXPECT_DECLS;
37976- #if defined(WOLFSSL_HAVE_LMS) && !defined(WOLFSSL_LMS_VERIFY_ONLY)
37980+ #if defined(WOLFSSL_HAVE_LMS) && !defined(WOLFSSL_LMS_VERIFY_ONLY) && \
37981+ (!defined(WOLFSSL_LMS_MAX_HEIGHT) || (WOLFSSL_LMS_MAX_HEIGHT >= 10))
3797737982 LmsKey key;
3797837983 LmsKey vkey;
3797937984 WC_RNG rng;
@@ -38012,7 +38017,11 @@ int test_wc_LmsKey_reload_cache(void)
3801238017 ExpectIntEQ(wc_LmsKey_Sign(&key, sig, &sigSz, msg, sizeof(msg)), 0);
3801338018
3801438019 ExpectIntEQ(wc_LmsKey_Init(&vkey, NULL, INVALID_DEVID), 0);
38020+ #if !defined(WOLFSSL_LMS_MAX_HEIGHT) || (WOLFSSL_LMS_MAX_HEIGHT >= 10)
3801538021 ExpectIntEQ(wc_LmsKey_SetParameters(&vkey, 1, 10, 8), 0);
38022+ #else
38023+ ExpectIntEQ(wc_LmsKey_SetParameters(&vkey, 1, 5, 8), 0);
38024+ #endif
3801638025 ExpectIntEQ(wc_LmsKey_ImportPubRaw(&vkey, pub, pubSz), 0);
3801738026 ExpectIntEQ(wc_LmsKey_Verify(&vkey, sig, sigSz, msg, sizeof(msg)), 0);
3801838027
@@ -38688,9 +38697,15 @@ int test_rfc9802_lms_x509_verify(void)
3868838697 * or SHAKE-only builds skip this block. */
3868938698 static const char* const lmsFiles[] = {
3869038699 "./certs/lms/bc_lms_sha256_h5_w4_root.der",
38700+ #if !defined(WOLFSSL_LMS_MAX_HEIGHT) || (WOLFSSL_LMS_MAX_HEIGHT >= 10)
3869138701 "./certs/lms/bc_lms_sha256_h10_w8_root.der",
38702+ #endif
38703+ #if !defined(WOLFSSL_LMS_MAX_LEVELS) || (WOLFSSL_LMS_MAX_LEVELS >= 2)
3869238704 "./certs/lms/bc_hss_L2_H5_W8_root.der",
38705+ #endif
38706+ #if !defined(WOLFSSL_LMS_MAX_LEVELS) || (WOLFSSL_LMS_MAX_LEVELS >= 3)
3869338707 "./certs/lms/bc_hss_L3_H5_W4_root.der",
38708+ #endif
3869438709 "./certs/lms/bc_lms_native_bc_root.der",
3869538710 };
3869638711 size_t i;
0 commit comments