Bound TPM2 response decrypt-parameter size, zeroize primary-key auth, and expand marshalling/import test coverage#555
Open
aidangarske wants to merge 5 commits into
Open
Conversation
aidangarske
commented
Jul 20, 2026
Member
There was a problem hiding this comment.
Pull request overview
This PR hardens wolfTPM’s response-processing and auth-handling paths against attacker-controlled TPM/transport inputs, and expands unit-test coverage for marshalling/import boundary cases.
Changes:
- Add bounds enforcement so response parameter decryption cannot write past the declared parameter area (
TPM2_ResponseProcess). - Zeroize duplicated primary-key auth material after
wolfTPM2_CreatePrimaryKey_exreturns (wolfTPM2_CreatePrimaryKey). - Expand unit tests for decrypt-parameter size overflow, signature/public marshalling roundtrips, and RSA/ECC import seed boundary checks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/unit_tests.c | Adds regression/coverage tests for response decrypt sizing, signature/public marshalling, and import bounds. |
| src/tpm2.c | Adds bounds checking for response decrypt region sizing in TPM2_ResponseProcess. |
| src/tpm2_wrap.c | Zeroizes the local primary-key struct copy to scrub duplicated auth data. |
| src/fwtpm/fwtpm_command.c | Switches PolicyPassword plaintext auth comparison to a fixed-trip-count constant-time helper. |
aidangarske
force-pushed
the
fenrir-fixes-7011-7020
branch
from
July 20, 2026 18:46
c13f264 to
79f497b
Compare
aidangarske
marked this pull request as ready for review
July 20, 2026 18:49
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.