Skip to content

refactor(attestation): align nonce definition to implemented thumbprint+salt#358

Merged
imran-siddique merged 1 commit into
mainfrom
align/nonce-thumbprint-salt
Jun 26, 2026
Merged

refactor(attestation): align nonce definition to implemented thumbprint+salt#358
imran-siddique merged 1 commit into
mainfrom
align/nonce-thumbprint-salt

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

refactor(attestation): align nonce definition to the implemented thumbprint+salt

The codebase carried two nonce definitions. The implemented and verifier-enforced
one (startup.py + cmcp_verify._verify_key_binding + test_verify.py) is:

nonce = JWK_thumbprint(tee_public_key)(32) || random_salt(32)

with the session bound separately via the signed gateway.session_id. A second,
unused definition -- SHA-256(tee_public_key || session_id) -- lived in make_nonce,
the spec, provider docstrings, and the claim4 experiment/tests. This aligns those
to the implemented design (the better one: RFC 7638 standard key binding, per-startup
freshness via salt, and a lifecycle that fits a startup-time hardware report).

  • make_nonce now returns thumbprint||salt; adds jwk_thumbprint() helper
  • docs/spec/attestation.md §3.3 rewritten (+ §3.3.1 session binding); provider
    report_data references updated
  • claim4 experiment + tests + README rewritten around key binding / freshness /
    session-binding-via-signature
  • test_tee make_nonce tests updated

Verified: ruff + mypy clean, 79 affected tests pass, claim4 experiment exits 0.

NOTE: the TPM verifier (cmcp_verify/tpm.py qualifying_data) still checks the old
SHA-256(pubkey||session_id) formula, disagreeing with the TPM provider (which uses
the startup nonce). That is a separate, pre-existing verifier bug flagged for a
hardware-tested follow-up; not changed here.

…bprint+salt

The codebase carried two nonce definitions. The implemented and verifier-enforced
one (startup.py + cmcp_verify._verify_key_binding + test_verify.py) is:

    nonce = JWK_thumbprint(tee_public_key)(32) || random_salt(32)

with the session bound separately via the signed gateway.session_id. A second,
unused definition -- SHA-256(tee_public_key || session_id) -- lived in make_nonce,
the spec, provider docstrings, and the claim4 experiment/tests. This aligns those
to the implemented design (the better one: RFC 7638 standard key binding, per-startup
freshness via salt, and a lifecycle that fits a startup-time hardware report).

- make_nonce now returns thumbprint||salt; adds jwk_thumbprint() helper
- docs/spec/attestation.md §3.3 rewritten (+ §3.3.1 session binding); provider
  report_data references updated
- claim4 experiment + tests + README rewritten around key binding / freshness /
  session-binding-via-signature
- test_tee make_nonce tests updated

Verified: ruff + mypy clean, 79 affected tests pass, claim4 experiment exits 0.

NOTE: the TPM *verifier* (cmcp_verify/tpm.py qualifying_data) still checks the old
SHA-256(pubkey||session_id) formula, disagreeing with the TPM provider (which uses
the startup nonce). That is a separate, pre-existing verifier bug flagged for a
hardware-tested follow-up; not changed here.
@imran-siddique imran-siddique merged commit 0d3c000 into main Jun 26, 2026
12 checks passed
@imran-siddique imran-siddique deleted the align/nonce-thumbprint-salt branch June 26, 2026 23:21
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