feat(tee): share the validated DCAP v4 signature-section parse - #247
Merged
Conversation
Expose parse_tdx_quote_signature() and TdxQuoteSignature so cmcp and ca2a can delegate the TDX quote layout instead of carrying their own copy of the offsets. Real DCAP v4 quotes nest the Quoting Enclave material: the bytes after the attestation key are a type-6 QE_REPORT_CERTIFICATION_DATA header, and the QE report, its PCK signature, the auth data and the type-5 PCK chain live inside it. A flat parse reads the QE report six bytes early and rejects every genuine quote. Both sibling repos have that bug today, found by running their verifiers against the real GCP C3 quote this parser was written against. verify_tdx_quote() now calls the shared parse, so the layout has one copy, and two regression tests pin the nested structure and the type check. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
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.
Landing work that was sitting unpushed on a local branch. Rebased onto current main, one changelog conflict resolved (the entry belongs under
[Unreleased], above the now-released 0.6.1 section).What it does
Exposes
parse_tdx_quote_signature()andTdxQuoteSignatureso cmcp and ca2a can delegate the TDX quote layout instead of each carrying its own copy of the offsets.verify_tdx_quote()now calls the shared parse, so the layout has one definition.Why it matters beyond deduplication
Real DCAP v4 quotes nest the Quoting Enclave material: the bytes after the attestation key are a type-6
QE_REPORT_CERTIFICATION_DATAheader, and the QE report, its PCK signature, the auth data, and the type-5 PCK chain all live inside it. A flat parse reads the QE report six bytes early and therefore rejects every genuine quote.Per the commit, both sibling repos have that bug today, found by running their verifiers against the real GCP C3 quote this parser was written against. So this is the shared, hardware-validated version, and the sibling fixes become a delegation rather than two more hand-rolled parses.
Two regression tests pin the nested structure and the type check.
Verification
Follow-up, not in this PR
cmcp and ca2a still carry their own TDX offset parses with the flat-layout bug. Switching them to
parse_tdx_quote_signature()is a separate change per repo, and worth doing while the reason is fresh.