refactor(attestation): align nonce definition to implemented thumbprint+salt#358
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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).
report_data references updated
session-binding-via-signature
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.