Skip to content

Commit 961d5c8

Browse files
committed
CMake: wire WOLFSSL_HAVE_XMSS and add XMSS verify-only/small sub-options
CMake accepted -DWOLFSSL_XMSS=1 but never emitted WOLFSSL_HAVE_XMSS, so wc_xmss.c compiled empty and options.h advertised no XMSS support. Add the missing definition block (mirroring LMS) plus WOLFSSL_XMSSVERIFYONLY and WOLFSSL_XMSSSMALL sub-options for parity with autotools --enable-xmss= verify-only,small, and expose all three in the generated options.h. Also enable WOLFSSL_XMSS in the cmake.yml CI build, which tested LMS but not XMSS -- the blind spot that let this regression through.
1 parent 2c5e135 commit 961d5c8

4 files changed

Lines changed: 32 additions & 1 deletion

File tree

.github/workflows/cmake.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
-DWOLFSSL_TLSX:BOOL=yes -DWOLFSSL_TPM:BOOL=yes -DWOLFSSL_CLU:BOOL=yes -DWOLFSSL_USER_SETTINGS:BOOL=no \
7272
-DWOLFSSL_USER_SETTINGS_ASM:BOOL=no -DWOLFSSL_WOLFSSH:BOOL=ON -DWOLFSSL_X86_64_BUILD_ASM:BOOL=yes \
7373
-DWOLFSSL_MLKEM:BOOL=yes -DWOLFSSL_LMS:BOOL=yes -DWOLFSSL_LMSSHA256192:BOOL=yes \
74+
-DWOLFSSL_XMSS:BOOL=yes \
7475
-DWOLFSSL_X963KDF:BOOL=yes -DWOLFSSL_DILITHIUM:BOOL=yes -DWOLFSSL_PKCS11:BOOL=yes \
7576
-DWOLFSSL_ECCSI:BOOL=yes -DWOLFSSL_SAKKE:BOOL=yes -DWOLFSSL_SIPHASH:BOOL=yes \
7677
-DWOLFSSL_WC_RSA_DIRECT:BOOL=yes -DWOLFSSL_PUBLIC_MP:BOOL=yes \

CMakeLists.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,32 @@ add_option(WOLFSSL_XMSS
11221122
"Enable the wolfSSL XMSS implementation (default: disabled)"
11231123
"no" "yes;no")
11241124

1125+
add_option(WOLFSSL_XMSSVERIFYONLY
1126+
"Enable the XMSS/XMSS^MT verify-only implementation (default: disabled)"
1127+
"no" "yes;no")
1128+
1129+
add_option(WOLFSSL_XMSSSMALL
1130+
"Enable the smaller, slower XMSS/XMSS^MT implementation (default: disabled)"
1131+
"no" "yes;no")
1132+
1133+
if (WOLFSSL_XMSS)
1134+
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_HAVE_XMSS")
1135+
1136+
set_wolfssl_definitions("WOLFSSL_HAVE_XMSS" RESULT)
1137+
1138+
if (WOLFSSL_XMSSVERIFYONLY)
1139+
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_XMSS_VERIFY_ONLY")
1140+
1141+
set_wolfssl_definitions("WOLFSSL_XMSS_VERIFY_ONLY" RESULT)
1142+
endif()
1143+
1144+
if (WOLFSSL_XMSSSMALL)
1145+
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_WC_XMSS_SMALL")
1146+
1147+
set_wolfssl_definitions("WOLFSSL_WC_XMSS_SMALL" RESULT)
1148+
endif()
1149+
endif()
1150+
11251151
# SLH-DSA
11261152
add_option(WOLFSSL_SLHDSA
11271153
"Enable the wolfSSL SLH-DSA implementation (default: disabled)"

cmake/options.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ extern "C" {
413413
#cmakedefine WOLFSSL_HAVE_XMSS
414414
#undef WOLFSSL_WC_XMSS
415415
#cmakedefine WOLFSSL_WC_XMSS
416+
#undef WOLFSSL_XMSS_VERIFY_ONLY
417+
#cmakedefine WOLFSSL_XMSS_VERIFY_ONLY
418+
#undef WOLFSSL_WC_XMSS_SMALL
419+
#cmakedefine WOLFSSL_WC_XMSS_SMALL
416420
#undef HAVE_SECRET_CALLBACK
417421
#cmakedefine HAVE_SECRET_CALLBACK
418422
#undef WC_RSA_DIRECT

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,7 @@ do
19931993
no)
19941994
;;
19951995
verify-only)
1996-
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_XMSS_VERIFY_ONLY -DXMSS_VERIFY_ONLY"
1996+
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_XMSS_VERIFY_ONLY"
19971997
;;
19981998
small)
19991999
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_XMSS_SMALL"

0 commit comments

Comments
 (0)