Expand description
The proof agentmux-srv open and a headless srv give each other before open asks for anything.
SPEC_HEADLESS_SERVER_PACKAGE_AND_LOCAL_WEB_UI Β§3.
open never sends the key. It sends a fresh nonce; srv answers with its own nonce and a MAC, made
with the key, over both nonces and the address srv is bound to. open checks that MAC against the
address it is talking to before it sends anything else, so a listener without the key, or one that
forwards to the real srv from another port, gets nothing it can reuse. Each later request then
carries a MAC of its method, path, body and a rising sequence number, under a key made from the
key and both nonces, and each answer carries one too. Every MAC has its own label, so a MAC made
for one purpose is never valid for another.
StructsΒ§
- Admitted π
- A request that proved itself: the answer to it is proved with this.
- Channel π
- Channel
Key π - A channelβs key, kept in memory only.
- Channels π
- The channels
openhas begun. Memory only. - Client π
openβs end of a channel, after srv proved itself.- Hello π
- srvβs answer to a hello.
- Hello
Reply π - What srv said in its hello.
- NotProved π
- A hello that did not prove srv holds the key, or is bound to the address
openis talking to. - Signed π
ConstantsΒ§
- CHANNEL_
HEADER π - CHANNEL_
LIFE π - A channel lives this long: more than a sign-in takes (a minute for the browser, a minute for the answer).
- MAX_
CHANNELS π - At most this many channels at once; a new one beyond it replaces the oldest that has proved nothing.
- PROOF_
HEADER π - SEQ_
HEADER π
FunctionsΒ§
- channel_
key π - The key of one channel: made from the key and everything the hello proved.
- hello_
proof π - What srv proves in its hello: it holds the key, and is bound to
boundwithdeclaredas the other origin it accepts (empty when none). - is_
nonce π - A nonce is 32 random bytes as 64 lowercase hex characters.
- mac π
- MAC over length-prefixed parts under
key, so no two part lists give the same input. - new_
nonce π - request_
proof π - response_
proof π - The proof on srvβs answer to request number
seq.
Type AliasesΒ§
- Hmac256 π