Add capabilities to properly show FIPS 140-3#502
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds explicit FIPS 140-3 support to the capabilities surface so callers can distinguish between FIPS 140-2 and FIPS 140-3 based on TPM_PT_MODES (TPMA_MODES).
Changes:
- Extend
WOLFTPM2_CAPSwith afips140_3flag and decode TPMA_MODES bit 1 in capability parsing. - Introduce
TPMA_MODESand masks intpm2.hand use them in parsing/emission. - Update test/example output to display FIPS 140-3 when indicated.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| wolftpm/tpm2_wrap.h | Adds fips140_3 capability flag and clarifies FIPS 140-2 comment. |
| wolftpm/tpm2.h | Defines TPMA_MODES and bit masks for FIPS 140-2/140-3. |
| src/tpm2_wrap.c | Decodes TPM_PT_MODES using new masks into both fips140_2 and fips140_3. |
| src/fwtpm/fwtpm_command.c | Emits TPM_PT_MODES reflecting wolfCrypt FIPS level (140-2 vs 140-3). |
| tests/unit_tests.c | Updates debug print to prefer FIPS 140-3 when present. |
| examples/wrap/wrap_test.c | Updates capability output formatting for FIPS 140-2 vs 140-3. |
| examples/wrap/caps.c | Updates capability output formatting for FIPS 140-2 vs 140-3. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aidangarske
approved these changes
May 11, 2026
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.
ZD 21780