Skip to content

Support RFC 9802 LMS and XMSS in X.509 certificate and CSR generation#10572

Open
Frauschi wants to merge 1 commit into
wolfSSL:masterfrom
Frauschi:lms_xmss_cert_gen
Open

Support RFC 9802 LMS and XMSS in X.509 certificate and CSR generation#10572
Frauschi wants to merge 1 commit into
wolfSSL:masterfrom
Frauschi:lms_xmss_cert_gen

Conversation

@Frauschi
Copy link
Copy Markdown
Contributor

@Frauschi Frauschi commented Jun 2, 2026

Extends wolfCrypt's certificate generation to issue HSS/LMS and XMSS/XMSS^MT certificates and PKCS#10 requests, building on the existing RFC 9802 verification support so the library can now both produce and consume stateful hash-based-signature certificates.

Changes

  • New key-type selectors LMS_TYPE / XMSS_TYPE / XMSSMT_TYPE for wc_MakeCert_ex, wc_SignCert_ex, and wc_MakeCertReq_ex.
  • New SPKI encoders wc_LmsKey_PublicKeyToDer and wc_XmssKey_PublicKeyToDer to emit RFC 9802 SubjectPublicKeyInfo.
  • Runtime signature-buffer sizing and sigType/key consistency checks for the new algorithms.
  • Generation is ASN.1-template only (WOLFSSL_ASN_TEMPLATE), matching where the verification path already lives. Non-template builds reject these key types with ALGO_ID_E.

Tests

  • New in-process tests generate self-signed LMS/XMSS roots, CSRs, and a CA→ECC-leaf chain, then verify each through the parsing/verification path.
  • These replace the previously checked-in (patched Bouncy Castle) DER fixtures; only the stock RFC 9802-aligned LMS interop anchor is retained.

No change to default builds — the feature is gated behind the existing LMS/XMSS and certificate-generation options.

Extend wc_MakeCert_ex/wc_SignCert_ex/wc_MakeCertReq_ex to issue HSS/LMS and
XMSS/XMSS^MT certificates and PKCS#10 requests, building on the existing
RFC 9802 verification support. New LMS_TYPE/XMSS_TYPE/XMSSMT_TYPE selectors,
wc_{Lms,Xmss}Key_PublicKeyToDer SPKI encoders, runtime signature-buffer
sizing, and sigType/key consistency checks. Generation is ASN.1-template
only, matching where the verification path lives.

Tests generate self-signed roots, CSRs and a CA->ECC-leaf chain in-process
and verify them, replacing the patched Bouncy Castle fixtures (only the stock
RFC 9802-aligned LMS interop anchor is kept).
@Frauschi Frauschi self-assigned this Jun 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

MemBrowse Memory Report

No memory changes detected for:

@Frauschi Frauschi assigned wolfSSL-Bot and unassigned Frauschi Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants