Skip to content

Add SLH-DSA keygen fallback without wrap attributes - #687

Merged
mtrojnar merged 1 commit into
OpenSC:masterfrom
olszomal:fix-slhdsa-keygen-fallback
Sep 23, 2026
Merged

mtrojnar merged 1 commit into
OpenSC:masterfrom
olszomal:fix-slhdsa-keygen-fallback

Conversation

@olszomal

Copy link
Copy Markdown
Collaborator

Pull Request Type

  • Bug fix
  • New feature
  • Code style / formatting / renaming
  • Refactoring (no functional or API changes)
  • Build / CI related changes
  • Documentation
  • Other (please describe):

Related Issue

Fixes #685

Current Behavior

SLH-DSA key generation fails on HSMs that reject CKA_WRAP or CKA_UNWRAP.

New Behavior

Retry SLH-DSA key generation without these attributes, using the same fallback as ML-DSA and ML-KEM.

Scope of Changes

  • Share the no-wrap key template fallback across ML-DSA, ML-KEM, and SLH-DSA.
  • Generalize the fallback for HSMs such as Thales Luna and Entrust nShield.

Testing

  • Existing tests
  • New tests added
  • Manual testing

Not tested with SLH-DSA because I do not have access to a token that supports SLH-DSA.

Additional Notes

License Declaration

  • I hereby agree to license my contribution under the project's license.

Reuse the no-wrap key template fallback for ML-DSA, ML-KEM, and
SLH-DSA.

Thales Luna and Entrust nShield HSMs are known to require this
fallback for some PQC key types because they reject CKA_WRAP or
CKA_UNWRAP.
@mtrojnar
mtrojnar merged commit bf278bc into OpenSC:master Sep 23, 2026
11 checks passed
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.

openssl genpkey failing for SLHDSA with ckr inconsistant template on 0.4.21

2 participants