-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add TPM2 provider and WIT runtime for hardware crypto #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
TPM2 Provider (Linux/Windows): - Implement Tpm2Provider with ECDSA P-256 signing - Auto-detect TCTI (device, resource manager, TBS, swtpm) - Platform-gated compilation (excluded on macOS) - DER signature encoding for p256 crate compatibility - Comprehensive tests (require swtpm simulator) WIT Runtime (wasmtime integration): - Add wsc:crypto WIT interface for hardware signing - Implement CryptoHostState bridging WIT to SecureKeyProvider - WscRuntime for hosting WASM components with hardware crypto - Support for key generation, signing, verification via opaque handles CI: - Add GitHub Actions workflow for TPM2 tests with swtpm - Compile checks for macOS and Windows 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace WSError::HardwareNotAvailable with WSError::HardwareError - Use NetworkTPMConfig instead of SwtpmConfig for swtpm connection - Use PublicKey::try_from for ECC public key extraction instead of matching on PublicKeyUnion - Implement load_key method (returns KeyNotFound for now) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace as_bytes() with value() for EccParameter - Replace WSError::InvalidSignature with InvalidKeyHandle/VerificationError - Use ctx.hash() to get Digest and HashcheckTicket for signing - Remove unused sha2::Digest import - Import MaxBuffer for hash data buffer 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Wrap TPM operations with execute_with_nullauth_session to provide necessary authorization context for: - create_primary (key generation) - hash and sign operations This fixes the "Not enough sessions provided for the command" error (0x0007000b) when running with swtpm simulator. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The tss-esapi crate doesn't have pre-generated bindings for Windows x86_64, causing CI failure. Windows TPM support would require a different implementation using the TBS (TPM Base Services) API. Changes: - Update Cargo.toml target to cfg(target_os = "linux") only - Update platform/mod.rs cfg guards to Linux-only - Update platform/tpm2.rs documentation - Update CI workflow with explanatory comments 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Pin Bazel version to 8.5.1 for CI compatibility - Bazel 9.x has stricter module visibility that breaks aspect_bazel_lib - Add proc_macro_deps for maybe-async in BUILD.bazel - Use stable rules_wasm_component commit (27eefae) to avoid componentize-py canary checksum instability Note: The newer rules_wasm_component commits (58b80d2+) use canary builds for componentize-py which have constantly changing checksums, causing CI failures. Using the older stable commit until checksums are properly managed upstream. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
33b1838 to
0363158
Compare
Sigstore rotated their fulcio.sigstore.dev TLS certificate. Updated the certificate pin from the previous fingerprint to the new one: a1ab2a71570894a6d9b2e539ec31419968cc3192b8c64bafb016bb72013f4087 The previous pin is kept in the list for rotation grace period. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Phase 2 of the plan: SLSA L4 reproducibility tracking support: - reproducibility.rs: BuildEnvironment, MaterialManifest, DependencyPin structures for capturing everything needed to reproduce a build - dsse.rs: Dead Simple Signing Envelope implementation per DSSE spec for standards-compliant attestation signing Key capabilities: - Automatic CI/CD builder detection (GitHub Actions, GitLab, CircleCI, Azure Pipelines, Jenkins) - Complete dependency pinning with cryptographic hashes - in-toto Statement and Subject support - SLSA ResourceDescriptor with PURL parsing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The DSSE module requires base64 for payload encoding. This was added to Cargo.toml but not to the Bazel BUILD.bazel file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
Tpm2Providerfor hardware-backed ECDSA P-256 signing via TPM 2.0wsc:crypto) for hosting WASM components with hardware cryptoTPM2 Provider
tss-esapicrate (v7) for TSS2 API/dev/tpmrm0,/dev/tpm0, Windows TBS, orTPM2_TCTIenv varWIT Runtime
wsc:crypto/hardware-signingWIT interface for opaque key handle operationsCryptoHostState<P>bridges WIT to anySecureKeyProviderimplementationWscRuntime<P>for loading and running WASM componentsTest plan
--features tpm2