Skip to content

Improve get_ek_certs to handle indices#455

Merged
aidangarske merged 2 commits intowolfSSL:masterfrom
dgarske:ek_certs
Feb 19, 2026
Merged

Improve get_ek_certs to handle indices#455
aidangarske merged 2 commits intowolfSSL:masterfrom
dgarske:ek_certs

Conversation

@dgarske
Copy link
Contributor

@dgarske dgarske commented Feb 17, 2026

No description provided.

@dgarske dgarske self-assigned this Feb 17, 2026
@dgarske dgarske force-pushed the ek_certs branch 2 times, most recently from bc8c246 to 5b62ffd Compare February 19, 2026 21:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_EKIndex to accept the full TCG NV space range instead of just the EK certificate range
  • Enhanced error handling in get_ek_certs to 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.

@dgarske dgarske requested a review from aidangarske February 19, 2026 21:59
@aidangarske aidangarske removed their assignment Feb 19, 2026
@aidangarske aidangarske merged commit 438c63e into wolfSSL:master Feb 19, 2026
73 of 74 checks passed
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

Comments