feat(tpm): add type-safe NV certify attestation parsing - #304
Merged
imran-siddique merged 1 commit intoAug 15, 2026
Merged
Conversation
Signed-off-by: Noah Ing <98993329+noah-ing@users.noreply.github.com>
Contributor
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
imran-siddique
approved these changes
Aug 15, 2026
imran-siddique
left a comment
Member
There was a problem hiding this comment.
Reviewed the TPM wire parsing, framing/bounds behavior, public exports, regression coverage, and security-sensitive type separation. The common TPMS_ATTEST header and TPM_ST_ATTEST_NV union layout match the current TCG Part 2 structures; the distinct TPM_ST_ATTEST_NV_DIGEST selector is not conflated. CI evidence is green across lint, typing, security scan, governance, build, and completed test platforms. Approved.
zohebk8s
pushed a commit
to zohebk8s/agent-manifest
that referenced
this pull request
Aug 16, 2026
Only CHANGELOG.md conflicted, and only because both sides opened a new ## Unreleased / ### Added block. Both entries are kept under one heading, the TPM attest parsing from agentrust-io#304 first since it landed first, then the COSE conformance vectors. No code conflict. The 35 vectors still regenerate byte-identically after the merge, so nothing on main moved the engine's normative behaviour. Signed-off-by: Mohammed Zoheb Shaik <zoheb.shaik7@gmail.com>
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.
What
Add a shared
TPMS_ATTESTdispatch parser and a type-enforcingTPM_ST_ATTEST_NVentry point forTPMS_NV_CERTIFY_INFO.Why
This addresses the NV-certify consolidation scope added in #255. cMCP currently carries a local parser because
parse_tpm_quote()assumes the quote union and rejectsTPM_ST_ATTEST_NV. The new API lets consumers inspect the signed common header and safely parse a full NV certify without reimplementing TPM wire offsets.The high-level
parse_tpm_nv_certify()checks the signed attestation type before interpreting the union. The lower-level union parser remains available for callers that already dispatched onTpmAttest.attest_type. Size-prefixedTPM2B_ATTESTinput must consume the full outer buffer; undeclared trailing bytes now fail closed.This is the NV-certify portion of #255 only. It does not claim to close the remaining digest-agility or verification work.
Spec impact
None. SDK-only; no normative or conformance-level change.
Test plan
pytest -q tests- 874 passed, 6 skippedmypy src/agent_manifestpassesruff check src tests --select E,F,W --ignore E501passesbandit -r src/agent_manifest -c pyproject.tomlpassesCHANGELOG.mdupdatedDCO
All commits in this PR are signed off (
git commit -s). By submitting this PR I certify the Developer Certificate of Origin.