Skip to main content

Module same_machine

Module same_machine 

Source
Expand description

RFC-001 amendment (#182): same-owner same-machine signed attestation.

Wire already auto-pins sister sessions by reading their card off local disk (pull::maybe_autopin_local_sister) — a filesystem witness. Coral’s #182 review flagged that witness as too weak on its own: anything that can write the data-dir tree could mint a sibling. This module is the cryptographic hardening: an operator-signed claim, carried in the agent card, that a receiver verifies against ITS OWN machine before auto-pinning the sender at ORG_VERIFIED.

§The claim

same_machine_attestation = { machine_fingerprint, signature } where the signature is the operator root key (op_sk) over the domain-separated canonical message

wire-same-machine-v1|<fingerprint_hex>|<session_did>

Signing with op_sk (not the session key) is the point: it proves the operator who owns this session says all my sessions on machine X share this fingerprint, which is the trust-model claim the receiver acts on.

§Receiver safety (the two checks that make it sound)

  1. Fingerprint strict-equality — the receiver recomputes its own machine_fingerprint from its local (machine_id, os_user_id) and refuses unless the attestation’s fingerprint byte-equals it. A remote sender cannot know the receiver’s fingerprint without already being on the receiver’s machine.
  2. Signature over the canonical bytes — verified under the same inline op_pubkey the op-chain already validated. A card that publishes the receiver’s fingerprint but signs a different one (the hostile-forge case, AC-SM3) fails here.

§Deviations from the amendment doc (deliberate, equivalent)

  • sha256, not blake2b. A one-way 32-byte commitment; sha2 is already a dependency, blake2 is not. Domain tag wire-same-machine-v1 is unchanged.
  • canonical message is a domain-separated string (mirroring identity::succession_payload) rather than raw byte concatenation, so it reuses the audited sign_did_cert / verify_payload_sig path and can never be replayed as an op/member/succession cert.

Enums§

VerifyError
Errors verifying a received same-machine attestation. Every variant is a fall-through (the receiver drops the same-machine fast-path and proceeds with standard pairing), never a hard failure of the pull.

Constants§

FINGERPRINT_DOMAIN
Domain-separation tag. The v1 lets a future fingerprint construction ship as v2 without renaming the card field. Protects against cross-protocol collision on the shared machine_id identifier.

Functions§

attestation_payload
The canonical message the operator key signs / a receiver verifies. Domain-separated; the fingerprint is lowercase hex so the message is a plain printable string on the same sign_did_cert path as the other certs.
auto_pin_decision
Receiver decision (amendment §C, all 7 steps): should a received peer_card be auto-pinned at ORG_VERIFIED because it proves it is on THIS machine, owned by the SAME operator? Returns Some(peer_op_did) when every check passes, None to fall through to standard pairing. Fully offline.
build_attestation
Build the attestation: op_sk signs the canonical message over (fingerprint, session_did). Returns (machine_fingerprint_b64, signature_b64) ready to drop into the card’s same_machine_attestation.
local_fingerprint
Read this machine’s local fingerprint from platform sources. None when either source can’t be read (the session still functions; it just can’t participate in the same-machine lane — fail-closed per §A).
machine_fingerprint
Compute the 32-byte machine fingerprint from raw platform inputs.
verify_attestation
Verify a received attestation (amendment §C steps 4–6). Fail-closed.