Repository navigation
Conversation
embhorn
reviewed
Nov 2, 2026
embhorn
left a comment
Member
There was a problem hiding this comment.
Skoll Multi-Scan Review
Modes: review + review-security
Overall recommendation: COMMENT
Findings: 2 total — 2 posted, 0 skipped
2 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [Medium] [review] DHKEM capability remains set when ML-KEM is disabled —
wolftpm/fwtpm/fwtpm.h:57 - [Medium] [review] Test ECC rejection in the no-HKDF build —
tests/fwtpm_unit_tests.c:19480-19482
Review generated by Skoll
dgarske
force-pushed
the
fwtpm_dhkem_hkdf
branch
from
November 2, 2026 21:30
58bbe96 to
ff5e4af
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new workflow entry disables TLS 1.3 but runs the full test suite, whose unguarded TLS 1.3 cases cause the job to fail independently of the DHKEM fix.
1 open issue
What changed in this PR
This PR fixes fwTPM builds with ECC and ML-KEM enabled but HKDF disabled by gating ECC DHKEM support on its required features.
Changes:
- Adds
FWTPM_HAVE_DHKEMand applies it to DHKEM implementation and command dispatch. - Returns
TPM_RC_KEYfor ECC encapsulation and decapsulation when DHKEM is unavailable. - Guards DHKEM roundtrip tests and adds no-HKDF regression coverage and a CI configuration.
| File | Description |
|---|---|
wolftpm/fwtpm/fwtpm.h |
Defines DHKEM availability from ML-KEM, ECC, and HKDF support. |
tests/fwtpm_unit_tests.c |
Guards roundtrip tests and tests rejection without HKDF. |
src/fwtpm/fwtpm_crypto.c |
Compiles DHKEM helpers only when supported. |
src/fwtpm/fwtpm_command.c |
Gates ECC DHKEM dispatch and rejects unsupported keys. |
.github/workflows/fwtpm-test.yml |
Adds a v1.85 CI configuration without HKDF or TLS 1.3. |
Review effort: Balanced
dgarske
force-pushed
the
fwtpm_dhkem_hkdf
branch
from
November 2, 2026 22:32
ff5e4af to
88aa7ed
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.

Description
The v1.85 ECC DHKEM path behind
TPM2_Encapsulate/TPM2_Decapsulate(RFC 9180) callswc_HKDF_Extractandwc_HKDF_Expand, but it was compiled whenever ML-KEM andHAVE_ECCwere enabled. Auser_settings.hbuild with ML-KEM and ECC but withoutHAVE_HKDFhit an implicit declaration and then an undefined reference at link. configure builds did not see it because wolfSSL turns HKDF on for TLS 1.3, which is enabled by default.Fix
wolftpm/fwtpm/fwtpm.h- newFWTPM_HAVE_DHKEM, set whenWOLFTPM_MLKEM,HAVE_ECCandHAVE_HKDFare all defined. ML-KEM belongs in the condition because the DHKEM implementations sit inside the ML-KEM region and the only commands that reach them are gated on it, so the capability has to match that gate.src/fwtpm/fwtpm_crypto.c- the DHKEM helpers andFwEncapsulateEcdhDhkem/FwDecapsulateEcdhDhkembuild underFWTPM_HAVE_DHKEMinstead ofHAVE_ECC.src/fwtpm/fwtpm_command.c- Encapsulate and Decapsulate dispatch an ECC key to DHKEM only underFWTPM_HAVE_DHKEM; otherwise the key is rejected withTPM_RC_KEY.tests/fwtpm_unit_tests.c- the DHKEM roundtrip tests are guarded onFWTPM_HAVE_DHKEM, and a new test covers the other side: without it, an ECC key that still passes the Part 2 Sec.10.3.13 template checks is rejected by both commands.ML-KEM itself is unaffected; only ECC KEM keys depend on HKDF.
Testing
fwtpm_unit.testagainst a wolfSSL built without HKDF (--disable-tls13 --disable-hkdf, which also needs--enable-rsapss, since dropping TLS 1.3 drops RSA-PSS and fwTPM requires it): the new rejection test and the ML-KEM roundtrip both pass.fwtpm_unit.testagainst a wolfSSL with HKDF: the P-256, P-384 and P-521 DHKEM roundtrips still pass.fwtpm-v185-no-hkdfCI row builds that configuration and runs the handler tests, which nothing covered before.HAVE_HKDFnow builds cleanly.