Overview
Whenatls_connect() is called, the following steps execute:
- TLS handshake - Establish TLS connection using webpki-roots CA bundle
- Certificate capture - Extract server’s leaf certificate (DER-encoded)
- EKM extraction - Extract TLS session Exported Keying Material (RFC 9266)
- Policy → Verifier - Call
policy.into_verifier()to create the verifier - Attestation - Call
verifier.verify(stream, cert, session_ekm, hostname) - Return - Return
(TlsStream, Report)for continued communication
TLS handshake and session binding
TLS 1.3 connection
Atlas uses standard TLS 1.3 with CA certificate verification:EKM extraction for session binding
After the TLS handshake completes, Atlas extracts the session EKM (Exported Keying Material):The EKM uniquely identifies this TLS session. By including it in the attestation quote’s
report_data, the server proves the quote was generated specifically for this connection, preventing relay attacks.DStack TDX verification flow
For Intel TDX via DStack, the verifier executes these steps:Step 1: Generate nonce and request quote
Generate a random 32-byte nonce to prevent replay attacks:/tdx_quote endpoint:
- Base64-encoded TDX quote
- Base64-encoded event log
Step 2: Parse event log
Decode the event log using dstack-sdk-types:Step 3: Verify certificate binding
Compute SHA256 hash of the TLS certificate:This proves the TLS certificate was generated inside the TEE and measured into the event log before the quote was created.
Step 4: Verify DCAP quote
Fetch collateral from Intel PCS and verify the quote cryptographically:- Validates the quote signature using Intel’s root keys
- Checks the quote was signed by a genuine TDX CPU
- Extracts the
report_dataand measurements (MRTD, RTMRs) - Verifies TCB (Trusted Computing Base) status
The
verified_report is now cryptographically trusted. All subsequent checks compare against this verified report to establish the trust chain.Step 5: Verify report_data binding
Compute expected report_data from nonce and session EKM:- The quote was generated for this specific verification request (nonce)
- The quote is bound to this specific TLS session (EKM)
Step 6: Verify RTMR replay
Replay the event log to recompute RTMRs:RTMR replay establishes trust in the event log. Because the replayed RTMRs match the cryptographically verified report, we can now trust all measurements in the event log.
Step 7: Verify bootchain measurements
Compare bootchain measurements from the verified report against expected values:- MRTD - Initial TD memory contents (TDVF/firmware)
- RTMR0 - Virtual hardware environment
- RTMR1 - Linux kernel
- RTMR2 - Kernel cmdline + initramfs
Step 8: Verify app compose hash
Find the “compose-hash” event in the trusted event log:Step 9: Verify OS image hash
Find the “os-image-hash” event in the trusted event log:Trust chain summary
The verification flow establishes a complete trust chain:See also
- TLS handshake - TLS 1.3 connection details
- Quote retrieval - Quote fetching protocol
- Verification steps - Detailed verification checks