Skip to content

Add LMS Support - #459

Open
aidangarske wants to merge 2 commits into
wolfSSL:masterfrom
aidangarske:add-lms
Open

Add LMS Support#459
aidangarske wants to merge 2 commits into
wolfSSL:masterfrom
aidangarske:add-lms

Conversation

@aidangarske

@aidangarske aidangarske commented Aug 5, 2026

Copy link
Copy Markdown
Member

Description

  • Adds OpenSSL 3.6 compatible LMS verification support.
  • Imports and exports raw XDR LMS public keys.
  • Supports the OpenSSL message verification API.
  • Enforces wolfSSL 5.9.2 and required LMS parameter families.
  • Adds LMS unit, decoder, interoperability, and negative-path coverage.
  • Runs all 320 OpenSSL LMS KAT vectors in PQC CI.
  • Separates LMS and non-LMS dependency caches.
  • Rejects LMS FIPS builds until CAST integration is available.
  • Full Linux wolfProvider suite passed with OpenSSL 3.6.3 and wolfSSL 5.9.2-stable.
  • Combined ML-KEM, ML-DSA, and LMS KAT passed all 2,922 sub-tests.

Copilot AI lite review requested due to automatic review settings August 5, 2026 02:37
@aidangarske aidangarske changed the title Add OpenSSL compatible LMS verification Add LMS Support Aug 5, 2026
@aidangarske
aidangarske marked this pull request as ready for review August 5, 2026 02:37
@aidangarske aidangarske added the ci:libacvp-pqc PR OSP toggle: run libacvp-pqc label Aug 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/wp_lms.c
Comment thread src/wp_lms.c
@aidangarske aidangarske added ci:libacvp-pqc PR OSP toggle: run libacvp-pqc and removed ci:libacvp-pqc PR OSP toggle: run libacvp-pqc labels Aug 5, 2026
@aidangarske aidangarske self-assigned this Aug 5, 2026

@Frauschi Frauschi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐺 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 jobtest/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 castsrc/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 sourcesrc/wp_lms.c:58-528
  • [Medium] C99 compound literal in wp_lms_dec_decode - the only one in the whole src/ treesrc/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 failssrc/wp_lms.c:267-281,366-373
  • [Medium] wp_lms_verify_message_init silently discards the caller's OSSL_PARAM arraysrc/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 typesrc/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 insrc/wp_lms.c:128-141
  • [Low] Redundant pubLen checks in wp_lms_matchsrc/wp_lms.c:152-163
  • [Low] configure.ac summary line for LMS is misalignedconfigure.ac:272
  • [Low] test-pqc-kat.sh replaced the named EXPECTED_TESTS constant with inline magic numbersscripts/test-pqc-kat.sh:72-81
  • [Low] wp_lms_free() returns early on wc_LockMutex failure, leaking the key with no comment explaining the tradeoffsrc/wp_lms.c:92-100
  • [Low] check_openssl_lms_mismatch reports a misleading cause when the install directory exists but headers do notscripts/utils-openssl.sh:403-415
  • [Low] New system-wolfSSL guard omits WOLFPROV_PQC, so PQC/LMS builds can still fall back to the distro libwolfsslscripts/utils-wolfssl.sh:158-163
  • [Info] No ChangeLog.md entry for the new LMS featureChangeLog.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

Comment thread test/test_lms.c
Comment thread src/wp_lms.c Outdated
Comment thread src/wp_lms.c
Comment thread src/wp_lms.c Outdated
Comment thread src/wp_lms.c
Comment thread configure.ac Outdated
Comment thread scripts/test-pqc-kat.sh
Comment thread src/wp_lms.c
Comment thread scripts/utils-openssl.sh
Comment thread scripts/utils-wolfssl.sh
@aidangarske
aidangarske requested review from wolfSSL-Fenrir-bot and a balanced review from Copilot August 6, 2026 20:33

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/wp_lms.c Outdated
Comment thread src/wp_lms.c Outdated
Comment thread test/test_lms.c
Comment thread src/wp_lms.c Outdated
Comment thread src/wp_lms.c Outdated
Comment thread test/test_lms.c
Comment thread src/wp_lms.c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:libacvp-pqc PR OSP toggle: run libacvp-pqc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants