Skip to content

tpm-enacttrust: surface attester-bound nonce as a claim (#427)#432

Open
flaviens wants to merge 1 commit into
veraison:mainfrom
flaviens:fix/tpm-enacttrust-nonce-claim
Open

tpm-enacttrust: surface attester-bound nonce as a claim (#427)#432
flaviens wants to merge 1 commit into
veraison:mainfrom
flaviens:fix/tpm-enacttrust-nonce-claim

Conversation

@flaviens

Copy link
Copy Markdown

Fixes the freshness gap reported in #427.

The tpm-enacttrust scheme appraises the quote signature and the PCR digest against the reference value, but never exposes the nonce the attester bound into the quote's qualifying data (TPMS_ATTEST.ExtraData). A correctly-signed quote captured once can therefore be replayed to obtain affirming at any later time.

This surfaces ExtraData as the nonce claim in ExtractClaims, so an appraisal policy can compare it against the session's expected nonce (the eat_nonce the framework reflects into the EAR) and return contraindicated on a stale quote. Enforcement stays in policy rather than the scheme, so the default behaviour is unchanged and operators opt in.

Note on encoding: the evidence nonce is standard base64 while the EAT eat_nonce is URL-safe base64, so a policy should normalise before comparing.

Includes a regression test asserting the claim is surfaced.

Copilot AI review requested due to automatic review settings July 10, 2026 07:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR closes the nonce-freshness visibility gap in the tpm-enacttrust attestation scheme by surfacing the attester-bound quote qualifying data (TPMS_ATTEST.ExtraData) as a nonce claim during ExtractClaims. This enables appraisal policies to enforce challenge-response freshness (e.g., compare against the session eat_nonce) without changing the scheme’s default appraisal behavior.

Changes:

  • Expose TPMS_ATTEST.ExtraData as the nonce claim in scheme/tpm-enacttrust ExtractClaims.
  • Add a regression test that constructs an EnactTrust token with a chosen ExtraData value and asserts it is surfaced as claims["nonce"].

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scheme/tpm-enacttrust/scheme.go Adds nonce claim sourced from TPMS_ATTEST.ExtraData to support policy-based freshness checks.
scheme/tpm-enacttrust/scheme_test.go Adds regression test validating that ExtractClaims surfaces ExtraData as the nonce claim.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scheme/tpm-enacttrust/scheme.go Outdated
claims["firmware-version"] = decoded.AttestationData.FirmwareVersion
claims["node-id"] = decoded.NodeId.String()
claims["pcr-digest"] = []byte(decoded.AttestationData.AttestedQuoteInfo.PCRDigest)
// Surface the attester-bound qualifying data (TPMS_ATTEST.ExtraData) so an

@yogeshbdeshpande yogeshbdeshpande Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is not how the Challenge is verified.

Please refer to other schemes, where the Challenge (nonce) is verified during ValidateEvidenceIntegrity() check

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@yogeshbdeshpande yogeshbdeshpande left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please see the comments!

@flaviens
flaviens force-pushed the fix/tpm-enacttrust-nonce-claim branch from 6ac910b to 86bfd4e Compare July 10, 2026 10:39

@yogeshbdeshpande yogeshbdeshpande left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for making the changes, LGTM!

@yogeshbdeshpande

Copy link
Copy Markdown
Collaborator

@flaviens Please check the Integration tests, they also need modification, perhaps!

The tpm-enacttrust scheme appraised the quote signature and the PCR
digest, but never checked the nonce the attester bound into the quote's
qualifying data (TPMS_ATTEST.ExtraData). A correctly-signed quote
captured once could be replayed to obtain affirming at any later time.

ValidateEvidenceIntegrity now compares ExtraData against the session
nonce and returns BadEvidence on a mismatch, the same way the other
schemes check freshness. Includes tests for the matching and stale cases.

The integration tests are updated to match: the gen-token helper gains a
-nonce flag that binds the session nonce into ExtraData, the generator
passes the nonce through for enacttrust, and a stale-nonce row is added to
the freshness-check-fail test.
@flaviens
flaviens force-pushed the fix/tpm-enacttrust-nonce-claim branch from 86bfd4e to 9aee82a Compare July 10, 2026 12:58
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.

3 participants