Skip to content

Make simulator certs more realistic#541

Merged
kvinwang merged 1 commit intoDstack-TEE:masterfrom
eidola-ai:simulator-realistic-certificates
Mar 14, 2026
Merged

Make simulator certs more realistic#541
kvinwang merged 1 commit intoDstack-TEE:masterfrom
eidola-ai:simulator-realistic-certificates

Conversation

@mike-marcacci
Copy link
Contributor

The simulator's get_tls_key RPC produced RA-TLS certificates with a canned attestation whose report_data didn't match the actual TLS public key. Clients verifying report_data == SHA-512("ratls-cert:" || leaf_pubkey) would reject these certs. Fix by adding VersionedAttestation::set_report_data() and calling it in request_cert() when an attestation override is provided.

…tual TLS key

The simulator's get_tls_key RPC produced RA-TLS certificates with a canned
attestation whose report_data didn't match the actual TLS public key. Clients
verifying report_data == SHA-512("ratls-cert:" || leaf_pubkey) would reject
these certs. Fix by adding VersionedAttestation::set_report_data() and calling
it in request_cert() when an attestation override is provided.
Copy link
Collaborator

@kvinwang kvinwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Correctly updates both the struct field and raw quote bytes in sync.

Minor suggestions (non-blocking):

  1. The magic offset 568..632 is now duplicated with simulate_quote() — consider extracting a constant or having simulate_quote() call set_report_data() instead
  2. Silently skipping when quote length < 632 could hide data corruption — consider adding a warning log

@kvinwang kvinwang merged commit 00d3a9f into Dstack-TEE:master Mar 14, 2026
kvinwang added a commit that referenced this pull request Mar 14, 2026
Replace the duplicated magic offset `568..632` with a named constant
`TDX_QUOTE_REPORT_DATA_RANGE` and add a warning log when the quote is
too short to patch report_data, which would indicate data corruption.

Follow-up to PR #541.
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.

2 participants