Skip to content

Derive endorsed_tcb dynamically from attestation report in SNP test#7699

Merged
achamayou merged 2 commits intotest_endorsed_tcbfrom
copilot/sub-pr-7668
Mar 4, 2026
Merged

Derive endorsed_tcb dynamically from attestation report in SNP test#7699
achamayou merged 2 commits intotest_endorsed_tcbfrom
copilot/sub-pr-7668

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

The endorsed_tcb parameter in the SNP attestation test was hardcoded ("541700000000000a"), making it brittle across SNP hosts and processor architectures (Milan/Genoa/Turin) where the reported TCB varies.

Changes

  • tests/npm_tests.py: Replace the hardcoded endorsed_tcb value with one derived from reported_tcb in the first verifySnpAttestation response. The first call (already present in the test) returns the attestation report containing reported_tcb — a hex string encoding the actual TCB for the running architecture. That value is then passed as endorsed_tcb in the second call.
# First call (no endorsed_tcb) — captures reported_tcb from the live attestation
report_json = r.body.json()["attestation"]

# Second call — uses the actual reported_tcb, correct for Milan/Genoa/Turin
endorsed_tcb = report_json["reported_tcb"]
r = c.post("/app/verifySnpAttestation", {
    ...,
    "endorsed_tcb": endorsed_tcb,
})

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on verifySnpAttestation logic for endorsed TCB handling Derive endorsed_tcb dynamically from attestation report in SNP test Mar 4, 2026
@achamayou achamayou marked this pull request as ready for review March 4, 2026 19:53
@achamayou achamayou requested a review from a team as a code owner March 4, 2026 19:53
@achamayou achamayou merged commit 9a854df into test_endorsed_tcb Mar 4, 2026
16 checks passed
@achamayou achamayou deleted the copilot/sub-pr-7668 branch March 4, 2026 19:54
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