Improve get_ek_certs to handle indices#455
Merged
aidangarske merged 2 commits intowolfSSL:masterfrom Feb 19, 2026
Merged
Conversation
dgarske
commented
Feb 19, 2026
bc8c246 to
5b62ffd
Compare
There was a problem hiding this comment.
Pull request overview
This pull request enhances the get_ek_certs example to better handle various types of TPM NV indices beyond just EK certificate indices. The PR expands the validation range for NV indices to cover the entire TCG NV space (0x01C00000 - 0x01C07FFF) and adds new EK Policy index definitions for PolicyAuthorizeNV operations.
Changes:
- Added EK Policy index definitions for SHA256, SHA384, SHA512, and SM3_256 hash algorithms (0x7F01-0x7F04)
- Expanded NV index validation in
wolfTPM2_GetKeyTemplate_EKIndexto accept the full TCG NV space range instead of just the EK certificate range - Enhanced error handling in
get_ek_certsto identify and display information about non-certificate NV indices, including their type, size, attributes, and content
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| wolftpm/tpm2.h | Added four new EK Policy index constants for different hash algorithms (SHA256, SHA384, SHA512, SM3_256) in the TCG NV space |
| src/tpm2_wrap.c | Expanded the validation range in wolfTPM2_GetKeyTemplate_EKIndex from 0x1FF to 0x7FFF to accept all TCG NV space indices, with updated comment explaining the full range |
| examples/endorsement/get_ek_certs.c | Added comprehensive error handling and diagnostic output when encountering non-EK certificate indices, including a debug-mode function to display NV attributes and logic to read and display NV index contents |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aidangarske
reviewed
Feb 19, 2026
aidangarske
approved these changes
Feb 19, 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.
No description provided.