-
Notifications
You must be signed in to change notification settings - Fork 0
crypto: add TEE attestation service #22
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
Open
afeight
wants to merge
3
commits into
devin/1764876297-add-ed25519-secp256k1-crypto
Choose a base branch
from
devin/1764904831-add-tee-attestation-service
base: devin/1764876297-add-ed25519-secp256k1-crypto
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
crypto: add TEE attestation service #22
afeight
wants to merge
3
commits into
devin/1764876297-add-ed25519-secp256k1-crypto
from
devin/1764904831-add-tee-attestation-service
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
- Add TEEAttestationService for fetching and verifying TEE attestations - Add DstackVerifier using Phala API for TEE quote verification - Add unit tests for both components - Implements P-256 ECDH public key import from attestation Co-Authored-By: [email protected] <[email protected]>
Original prompt from [email protected] |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…ssion - Add CrossmintService and Http dependencies to Cryptography target - Create TEEAttestationEndpoint enum for /ncs/v1/attestation endpoint - Make TEEAttestationError conform to ServiceError protocol - Update TEEAttestationService to accept CrossmintService instead of apiBaseURL - Add MockCrossmintService for unit tests - DstackVerifier still calls Phala API directly for quote verification Co-Authored-By: [email protected] <[email protected]>
4 tasks
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.
crypto: add TEE attestation service
Summary
Adds TEE (Trusted Execution Environment) attestation functionality to the Swift SDK, translating the JavaScript implementation from open-signer. This enables native iOS apps to verify TEE attestations and obtain the TEE's public key for secure communication.
New Components:
TEEAttestationService- Actor that fetches attestation viaCrossmintService, verifies the TEE report, validates the public key commitment, and imports the P-256 ECDH public keyTEEAttestationEndpoint- Endpoint enum for/ncs/v1/attestationfollowing SDK patternsDstackVerifier- Verifier that calls Phala's API to verify Intel TDX quotes and extract report dataTEEQuoteVerifierprotocol - Allows for different verification strategiesTEEAttestationError- Conforms toServiceErrorfor proper error handling integrationNote: The
verifyTEEApplicationIntegritystep is skipped per request - this can be added in a follow-up PR.Updates since last revision
TEEAttestationServiceto useCrossmintServiceinstead of rawURLSessioncallsTEEAttestationEndpointenum following the SDK's endpoint pattern (e.g.,HeadlessCheckoutOrderEndpoint)TEEAttestationErrorconform toServiceErrorprotocol withfromServiceErrorandfromNetworkErrormappingsCrossmintServiceandHttpdependencies to the Cryptography targetMockCrossmintServiceReview & Testing Checklist for Human
/ncs/v1/attestationis correct. The SDK base URL ishttps://{env}crossmint.com/api, so the full path will be/api/ncs/v1/attestation. Confirm this matches the expected API route.verifyReportAttestsPublicKey: The SHA-512 hash verification depends on exact JSON serialization matching the TypeScript implementation. Swift uses.sortedKeyswhich should produce alphabetical ordering (publicKeybeforetimestamp). Verify this matches the server-side expectation.TEEAttestationError.fromNetworkErrorandfromServiceErrorproduce appropriate error messages for debugging.Test Plan
swift testto execute unit teststestTEEAttestationEndpointPathchecks that path is/ncs/v1/attestationTEEAttestationServicewith a realCrossmintServiceandDstackVerifier, callinitialize(), and verifygetAttestedPublicKey()returns a valid P-256 keyNotes
devin/1764876297-add-ed25519-secp256k1-crypto) which adds Ed25519 and Secp256k1 strategies