Skip to content

refactor: extract TDX quote report_data offset as a named constant#542

Merged
kvinwang merged 3 commits intomasterfrom
fix/simulator-report-data-constant
Mar 17, 2026
Merged

refactor: extract TDX quote report_data offset as a named constant#542
kvinwang merged 3 commits intomasterfrom
fix/simulator-report-data-constant

Conversation

@kvinwang
Copy link
Collaborator

Summary

  • Extract the duplicated magic offset 568..632 into a named constant TDX_QUOTE_REPORT_DATA_RANGE in dstack-attest
  • Use this constant in both VersionedAttestation::set_report_data() and simulate_quote()
  • Add a tracing::warn! when the TDX quote is too short to patch report_data, instead of silently skipping

Context

Follow-up to #541. The magic offset was duplicated in two places and a short quote was silently ignored, which could hide data corruption.

Test plan

  • cargo check -p dstack-attest -p dstack-guest-agent passes

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.
@kvinwang kvinwang merged commit 5aabbd0 into master Mar 17, 2026
11 checks passed
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.

1 participant