CMake: fix XMSS wiring and complete LMS/XMSS sub-option parity#10929
Open
Frauschi wants to merge 2 commits into
Open
CMake: fix XMSS wiring and complete LMS/XMSS sub-option parity#10929Frauschi wants to merge 2 commits into
Frauschi wants to merge 2 commits into
Conversation
Contributor
Author
|
Jenkins retest this please |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes CMake’s XMSS enablement so -DWOLFSSL_XMSS=1 actually results in WOLFSSL_HAVE_XMSS being defined (and emitted into the generated/installed options.h), and extends CMake to support the same LMS/XMSS “verify-only” and “small”/variant sub-options that autotools already supports. It also closes a CI gap by enabling XMSS in the primary CMake workflow.
Changes:
- Wire
WOLFSSL_XMSSin CMake to emitWOLFSSL_HAVE_XMSS, plus add XMSS sub-options forverify-onlyandsmall. - Add missing CMake LMS sub-options for
verify-only,small, andshake256, matching autotools behavior. - Remove the legacy unprefixed
XMSS_VERIFY_ONLYdefine from autotools, and enable XMSS in the main CMake GitHub Actions job.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| configure.ac | Removes the unused legacy -DXMSS_VERIFY_ONLY so autotools emits only WOLFSSL_XMSS_VERIFY_ONLY. |
| CMakeLists.txt | Adds XMSS wiring (WOLFSSL_HAVE_XMSS) and completes LMS/XMSS sub-option parity (verify-only/small/shake256). |
| cmake/options.h.in | Exposes new LMS/XMSS sub-option macros to generated options.h for CMake builds. |
| .github/workflows/cmake.yml | Enables -DWOLFSSL_XMSS in the main CMake CI build to prevent regressions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
CMake wired only the LMS sha256-192 and no-sha256-256 variants, while autotools --enable-lms also supports verify-only, small and shake256. Add the three missing sub-options (WOLFSSL_LMSVERIFYONLY, WOLFSSL_LMSSMALL, WOLFSSL_LMSSHAKE256), emitting WOLFSSL_LMS_VERIFY_ONLY, WOLFSSL_WC_LMS_SMALL and WOLFSSL_LMS_SHAKE256, and expose them in the generated options.h so the CMake and autotools LMS configurations match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CMake build accepted
-DWOLFSSL_XMSS=1but never emittedWOLFSSL_HAVE_XMSS— neither onto the library compile line nor into the installedoptions.h. Since every XMSS body is wrapped in#ifdef WOLFSSL_HAVE_XMSS, the option was a no-op:wc_xmss.ccompiled empty and consumers saw no XMSS support. LMS had the correct wiring. Autotools (--enable-xmss) was unaffected.While fixing this, CMake was also missing several LMS sub-options that autotools
--enable-lmsalready supports.Changes
XMSS (build-break fix) —
32ab46aCMakeLists.txt— add the missingif (WOLFSSL_XMSS)block (mirroring LMS), plusWOLFSSL_XMSSVERIFYONLY/WOLFSSL_XMSSSMALLsub-options for parity with autotools--enable-xmss=verify-only,small.cmake/options.h.in— exposeWOLFSSL_XMSS_VERIFY_ONLYandWOLFSSL_WC_XMSS_SMALL.configure.ac— drop the unused legacyXMSS_VERIFY_ONLYmacro (the un-prefixed twin is dead in-tree), so both build systems emit onlyWOLFSSL_XMSS_VERIFY_ONLY..github/workflows/cmake.yml— enableWOLFSSL_XMSSin the main CMake CI build (it tested LMS but not XMSS — the blind spot that let this through).LMS (parity follow-on) —
f377a54WOLFSSL_LMSVERIFYONLY,WOLFSSL_LMSSMALL,WOLFSSL_LMSSHAKE256(emittingWOLFSSL_LMS_VERIFY_ONLY,WOLFSSL_WC_LMS_SMALL,WOLFSSL_LMS_SHAKE256), matching autotools--enable-lms=verify-only,small,shake256.Verification
-DWOLFSSL_XMSS=1→options.hnow emits#define WOLFSSL_HAVE_XMSS;wc_XmssKey_*symbols exported (were absent before).verify-onlybuilds dropwc_{Xmss,Lms}Key_Sign/MakeKey, keepVerify— matches autotools.options.hwhen their parent (WOLFSSL_XMSS/WOLFSSL_LMS) is off.options.hno longer contains the dead bareXMSS_VERIFY_ONLY.Downstream
Unblocks wolfPKCS11 #206, whose CMake CI clones wolfSSL master and requires
WOLFSSL_HAVE_XMSS.