Skip to content

feat(tee): implement TPM, SEV-SNP, TDX, and Opaque provider stubs - #127

Merged
imran-siddique merged 1 commit into
mainfrom
feat/tee-providers
Jun 6, 2026
Merged

imran-siddique merged 1 commit into
mainfrom
feat/tee-providers

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

Summary

  • Adds TPMProvider (tpm2-pytss ESAPI with subprocess tpm2_pcrread fallback), measuring PCRs 0-7 via SHA-256 (SHA-1 fallback with measurement_note) and emitting a TPM2_Quote as raw_evidence
  • Adds SEVSNPProvider (Linux ioctl SNP_GET_REPORT on /dev/sev-guest), extracting the 48-byte measurement field at offset 0x60 in the SNP report
  • Adds TDXProvider (Linux ioctl TDX_CMD_GET_REPORT0 on /dev/tdx_guest), extracting the MRTD field at offset 0x90 in the TDREPORT
  • Adds OpaqueProvider stub (detect always False, get_attestation_report raises NotImplementedError)
  • All detect() methods return False gracefully on non-Linux, missing devices, or import errors — never raise
  • 19 unit tests in tests/unit/test_tee_providers.py; mypy strict passes

Test plan

  • python -m pytest tests/unit/test_tee_providers.py -q — 19 passed
  • python -m mypy src/cmcp_gateway/tee/ — no issues in 7 source files

Closes #83, Closes #89, Closes #93

🤖 Generated with Claude Code

Adds TPMProvider (tpm2-pytss + subprocess fallback), SEVSNPProvider
(ioctl SNP_GET_REPORT), TDXProvider (ioctl TDX_CMD_GET_REPORT0), and
OpaqueProvider (not-yet-implemented stub). All detect() methods return
False gracefully on non-Linux or missing hardware. 19 unit tests added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@imran-siddique
imran-siddique merged commit e9768c0 into main Jun 6, 2026
1 of 7 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.

[tee] Intel TDX provider implementation [tee] AMD SEV-SNP provider implementation [tee] TPM 2.0/vTPM provider implementation

1 participant