Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR applies a set of static-analysis-driven fixes across TPM tooling, parsers, storage backends, and disk/TPM secret handling to improve safety (bounds/resource checks) and reduce sensitive-data exposure.
Changes:
- Tighten validation/guarding: digest parsing in
policy_sign, qman portalcell-indexbounds, andfclose()on open failure. - Reduce sensitive-data exposure: remove TPM/disk secret debug printing and explicitly zero decrypted disk headers on exit paths.
- Improve keyvault store handle hygiene: clear handle state on close and add unit coverage for the behavior (plus new unit tests for
policy_signarg validation).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/unit-tests/unit-psa_store.c | Adds unit test asserting store handle state is cleared by wolfPSA_Store_Close(). |
| tools/unit-tests/unit-pkcs11_store.c | Adds unit test asserting store handle state is cleared by wolfPKCS11_Store_Close(). |
| tools/unit-tests/unit-policy-sign.c | New unit test binary validating policy_sign() rejects oversized/invalid hex args without invoking TPM/crypto paths. |
| tools/unit-tests/Makefile | Adds unit-policy-sign target and includes it in the unit test suite. |
| tools/tpm/policy_sign.c | Fixes digest parse error checks for unsigned sizes by casting before comparing to <= 0. |
| tools/fdt-parser/fdt-parser.c | Validates cell-index before indexing qman portal tables. |
| tools/elf-parser/elf-parser.c | Guards fclose() when fopen() fails. |
| src/x86/ahci.c | Removes logging of unlock secrets and reduces logging exposure. |
| src/update_flash.c | Removes printing of secrets/secret-check buffers during disk unlock flow. |
| src/update_disk.c | Zeroes decrypted disk header buffer on error paths and before boot. |
| src/psa_store.c | Clears entire store handle struct on close via memset. |
| src/pkcs11_store.c | Clears entire store handle struct on close via memset. |
| src/boot_arm32.c | Fixes invalid AIRCR VECTKEY literal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
5b0c4005)20c3b866)d1b488f0)8041e832)805b16e2)7e64e91c)916d9544)