Skip to content

feat(tee): share the validated DCAP v4 signature-section parse - #247

Merged
imran-siddique merged 1 commit into
mainfrom
feat/share-tdx-signature-parse
Jul 27, 2026
Merged

feat(tee): share the validated DCAP v4 signature-section parse#247
imran-siddique merged 1 commit into
mainfrom
feat/share-tdx-signature-parse

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

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() and TdxQuoteSignature so 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_DATA header, 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

  • 623 passed, 18 skipped (was 620 on the branch pre-rebase, 621 on main; +2 from this branch's regression tests)
  • mypy clean across 20 files, ruff clean

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.

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>
@imran-siddique
imran-siddique merged commit 43a0e35 into main Jul 27, 2026
14 checks passed
@imran-siddique
imran-siddique deleted the feat/share-tdx-signature-parse branch July 27, 2026 20:46
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.

1 participant