Skip to content

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
wolfSSL:masterfrom
aidangarske:fenrir-fixes-7011-7020
Open

Bound TPM2 response decrypt-parameter size, zeroize primary-key auth, and expand marshalling/import test coverage#555
aidangarske wants to merge 5 commits into
wolfSSL:masterfrom
aidangarske:fenrir-fixes-7011-7020

Conversation

@aidangarske

Copy link
Copy Markdown
Member
F-7011, F-7014, F-7017, F-7018, F-7019, F-7020

Copilot AI review requested due to automatic review settings July 20, 2026 17:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_ex returns (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.

Comment thread src/tpm2.c
@aidangarske
aidangarske force-pushed the fenrir-fixes-7011-7020 branch from c13f264 to 79f497b Compare July 20, 2026 18:46
@aidangarske
aidangarske marked this pull request as ready for review July 20, 2026 18:49
@aidangarske
aidangarske requested a review from embhorn July 20, 2026 22:00
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.

3 participants