Support ML-KEM credential activation and ML-DSA quotes in fwTPM - #592
Open
aidangarske wants to merge 1 commit into
Open
Support ML-KEM credential activation and ML-DSA quotes in fwTPM#592aidangarske wants to merge 1 commit into
aidangarske wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
A newly added unit-test TPMS_ATTEST walker can perform out-of-bounds reads on truncated/malformed buffers, which should be hardened to fail via assertions rather than risking undefined behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends fwTPM’s post-quantum (v1.85) support to unblock PQ attestation flows by enabling ML-KEM ActivateCredential and adding ML-DSA / Hash-ML-DSA signing for attestation commands, along with new unit tests and an end-to-end mssim example.
Changes:
- Allow restricted ML-KEM Storage Keys for MakeCredential/ActivateCredential and derive credential integrity/encryption using the key’s nameAlg and declared AES-CFB key size.
- Add ML-DSA and Hash-ML-DSA attestation signing paths (Quote/Certify/GetTime/NV_Certify) and handle ML-DSA scheme serialization/parsing as TPMS_EMPTY.
- Add fwTPM unit tests covering ML-KEM credential round-trip and ML-DSA attestation signing/verification; extend the PQ mssim E2E example to exercise the full client flow.
File summaries
| File | Description |
|---|---|
| wolftpm/fwtpm/fwtpm_crypto.h | Updates credential wrap/unwrap APIs to carry nameAlg for variable-hash integrity. |
| src/fwtpm/fwtpm_crypto.c | Adds ML-DSA/Hash-ML-DSA attestation signing and variable-hash credential integrity. |
| src/fwtpm/fwtpm_command.c | Enforces storage-key attributes for credential commands; ML-DSA-specific digest selection for Quote/NV_Certify. |
| src/tpm2_packet.c | Serializes ML-DSA schemes as TPMS_EMPTY (no trailing hashAlg). |
| tests/fwtpm_unit_tests.c | Adds unit tests for ML-KEM credential activation and ML-DSA/Hash-ML-DSA attestation flows. |
| examples/pqc/pqc_mssim_e2e.c | Extends PQ E2E example to drive ML-KEM credential activation and ML-DSA quote via the client API. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
aidangarske
force-pushed
the
pq-attestation-fix
branch
from
September 8, 2026 01:28
78b4398 to
9e70b98
Compare
aidangarske
marked this pull request as ready for review
September 8, 2026 01:35
aidangarske
force-pushed
the
pq-attestation-fix
branch
from
September 8, 2026 01:44
9e70b98 to
e971610
Compare
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.
the PQ flow in issue Question about ML-KEM ActivateCredential and Pure ML-DSA Quote support in fwTPM #589 failed
credential protection is derived from the key nameAlg and AES size so standard SHA-384/AES-256 ML-KEM EKs work
client flow against fwtpm_server