Add LMS Support - #459
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds verification-only LMS (RFC 8554 / NIST SP 800-208) support to wolfProvider for OpenSSL 3.6+, including raw XDR public key import/export, an XDR decoder, and CI/test coverage integration alongside existing PQC work (ML-KEM/ML-DSA).
Changes:
- Register LMS keymgmt, signature (verify-only), and XDR decoder implementations in the provider.
- Add LMS unit tests for import/export, XDR decoding, and unsupported operations.
- Extend build/test scripts and CI workflows to support LMS opt-in builds and LMS KAT vector runs.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit.h | Adds LMS unit test prototypes behind WP_HAVE_LMS. |
| test/unit.c | Registers LMS unit tests behind WP_HAVE_LMS. |
| test/test_lms.c | New LMS-focused unit tests (import/export, decode, unsupported ops). |
| test/include.am | Adds test/test_lms.c to unit test sources. |
| src/wp_wolfprov.c | Registers LMS in provider keymgmt/signature/decoder algorithm tables. |
| src/wp_lms.c | New LMS implementation: keymgmt import/export/match, verify-only signature, XDR decoder. |
| src/include.am | Adds src/wp_lms.c to library sources. |
| scripts/utils-wolfssl.sh | Adds LMS configure flags and mismatch checks for existing wolfSSL installs. |
| scripts/utils-wolfprovider.sh | Adds --enable-lms forwarding and avoids system wolfSSL when PQC/LMS requested. |
| scripts/utils-openssl.sh | Adds LMS mismatch check and enable-lms for OpenSSL builds when requested. |
| scripts/test-pqc-kat.sh | Extends KAT runner to optionally include LMS vectors and enforce expected sub-test counts. |
| scripts/build-wolfprovider.sh | Adds --enable-lms, version gating, and blocks LMS/PQC on FIPS builds and Debian packaging path. |
| README.md | Documents LMS opt-in usage and its verification-only contract/format expectations. |
| include/wolfprovider/settings.h | Adds compile-time gating for LMS availability and explicit error messages. |
| include/wolfprovider/alg_funcs.h | Declares LMS algorithm name and new dispatch tables. |
| docs/INTEGRATION_GUIDE.md | Documents --enable-lms and expands PQC section to include LMS. |
| configure.ac | Adds --enable-lms configure option and defines WOLFPROV_HAVE_LMS. |
| .github/workflows/wolfssl-versions-pqc.yml | Adds an LMS-only matrix row, adjusts eligibility logic, and separates cache variants. |
| .github/workflows/wolfssl-pqc-kat.yml | Adds LMS to the KAT matrix, caching, build flags, and runtime selection. |
| .github/workflows/nginx-pqc.yml | Updates PQC floor logic to v5.9.2-stable and adjusts eligibility checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Frauschi
left a comment
There was a problem hiding this comment.
🐺 Skoll Code Review
Overall recommendation: REQUEST_CHANGES
Findings: 18 total — 15 posted, 3 skipped
Posted findings
- [High] No unit test ever reaches wc_LmsKey_Verify - the entire verification path is untested outside the optional KAT job —
test/test_lms.c:321-378 - [Medium] wp_lms_dec_selection has the wrong first-parameter type for OSSL_FUNC_DECODER_DOES_SELECTION, and wp_lms_dec_decode still carries a dead (void)selection cast —
src/wp_lms.c:398-403,524 - [Medium] src/wp_lms.c has no WOLFPROV_ENTER/LEAVE tracing and no Doxygen comments, unlike every other provider source —
src/wp_lms.c:58-528 - [Medium] C99 compound literal in wp_lms_dec_decode - the only one in the whole src/ tree —
src/wp_lms.c:497-500 - [Medium] LMS keymgmt and signature dispatch tables omit GET_PARAMS/GETTABLE_PARAMS/DUP/DUPCTX, so EVP_PKEY_get_bits/size/security_bits return 0 and EVP_PKEY_dup fails —
src/wp_lms.c:267-281,366-373 - [Medium] wp_lms_verify_message_init silently discards the caller's OSSL_PARAM array —
src/wp_lms.c:308-327 - [Medium] wp_lms_import accepts any public-key length in [48,56] instead of deriving the exact length from the LMS type —
src/wp_lms.c:193-209 - [Medium] wp_lms_has() reports a public-only LMS key as a complete keypair, and the new test locks that in —
src/wp_lms.c:128-141 - [Low] Redundant pubLen checks in wp_lms_match —
src/wp_lms.c:152-163 - [Low] configure.ac summary line for LMS is misaligned —
configure.ac:272 - [Low] test-pqc-kat.sh replaced the named EXPECTED_TESTS constant with inline magic numbers —
scripts/test-pqc-kat.sh:72-81 - [Low] wp_lms_free() returns early on wc_LockMutex failure, leaking the key with no comment explaining the tradeoff —
src/wp_lms.c:92-100 - [Low] check_openssl_lms_mismatch reports a misleading cause when the install directory exists but headers do not —
scripts/utils-openssl.sh:403-415 - [Low] New system-wolfSSL guard omits WOLFPROV_PQC, so PQC/LMS builds can still fall back to the distro libwolfssl —
scripts/utils-wolfssl.sh:158-163 - [Info] No ChangeLog.md entry for the new LMS feature —
ChangeLog.md:10
Skipped findings
- [Medium] settings.h gates WP_HAVE_LMS on WP_WOLFSSL_PQC_CAPABLE, which is documented as the ML-DSA header marker
- [Low] Raw LMS type codes in wp_lms_xdr_pub_len have no named constants or spec reference
- [Low] wp_lms_new frees with OPENSSL_free on error paths while wp_lms_free uses OPENSSL_clear_free
Review generated by Skoll via Claude/Codex
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #459
Scan targets checked: wolfprovider-bugs, wolfprovider-src
Findings: 7
7 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
Description