Expand description
Commands from a device of the account to one of its machines (#88): to start or end a session, and later others.
They travel as input and output on a command channel of the
machine’s relay session, so the relay carries them like any other bytes.
The machine answers a ToMachine::Hello with a fresh
FromMachine::Challenge: a nonce and a one-time X25519 key, signed by
the machine’s key. The device signs the command, bound to the machine and
the nonce, with the account’s key, and seals it to the one-time key. The
machine opens it, checks the signature against the account key it pinned
at registration, uses the nonce once, runs the command and seals the
outcome to the account. The relay learns that a command went and its
size.
Structs§
- Session
Info - One of the machine’s sessions, as
Command::Listgives it. - Signed
- A command and the account’s signature of
command_bytes.
Enums§
- Command
- What the device asks.
- From
Machine - From the machine, as the data of an
output. - Outcome
- How a command went.
- ToMachine
- From the device, as the data of an
input.
Constants§
- CHANNEL_
PREFIX - What a command channel’s name starts with. Session channels are hex, so
the
mkeeps the two apart. - MAX_
FRAME - The most a command frame may take: room for a list of a few hundred sessions (bytes go as JSON numbers).
Functions§
- challenge_
bytes - What the machine signs in a challenge.
- command_
bytes - What the account signs: the command, bound to the machine and the challenge’s nonce.
- command_
info - What a sealed command is bound to.
- is_
command_ channel - Whether
channelis a command channel. - reply_
bytes - What the machine signs in a reply: the sealed outcome, bound to the machine and the challenge’s nonce.
- reply_
info - What a sealed outcome is bound to.