feat(tee): implement TPM, SEV-SNP, TDX, and Opaque provider stubs - #127
Merged
Merged
Conversation
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>
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.
Summary
TPMProvider(tpm2-pytss ESAPI with subprocesstpm2_pcrreadfallback), measuring PCRs 0-7 via SHA-256 (SHA-1 fallback withmeasurement_note) and emitting a TPM2_Quote asraw_evidenceSEVSNPProvider(LinuxioctlSNP_GET_REPORT on/dev/sev-guest), extracting the 48-byte measurement field at offset 0x60 in the SNP reportTDXProvider(LinuxioctlTDX_CMD_GET_REPORT0 on/dev/tdx_guest), extracting the MRTD field at offset 0x90 in the TDREPORTOpaqueProviderstub (detect always False, get_attestation_report raises NotImplementedError)detect()methods return False gracefully on non-Linux, missing devices, or import errors — never raisetests/unit/test_tee_providers.py; mypy strict passesTest plan
python -m pytest tests/unit/test_tee_providers.py -q— 19 passedpython -m mypy src/cmcp_gateway/tee/— no issues in 7 source filesCloses #83, Closes #89, Closes #93
🤖 Generated with Claude Code