Skip to main content

Module pairing

Module pairing 

Source

Structs§

Admission
Channel
A connection both sides keyed from the same code through SPAKE2; every frame after the opening is sealed with ChaCha20-Poly1305.
ChannelClosed
The other side closed the channel before replying; for a joiner this is how a wrong, retired or expired code shows.
HostSecrets
What a pairing listener accepts: a four-word code to type and a 128-bit secret for the QR invite. Both are retired together.
HostStatus
JoinCode
A code typed or scanned on the joining device.
JoinRequest
What the joining device sends once the code is proven.
KeyHandover
Every epoch of K_id the handing device holds, of any identity, wrapped for the restoring device. No device row is written for it.
KeyRequest
What a device restoring a backup sends a device running sb pair --restore-keys once the code is proven. It asks to be admitted to no identity.
PairingHost
A pairing listener: it takes joins one at a time until one completes, its lifetime runs out, or nobody polls its status for idle.
SshServer
A device’s sshd as its peers would reach it.
Taken
A join whose admission take stored.

Enums§

Accepted
CodeKind
Which secret a joiner runs SPAKE2 over, sent in its first frame.
HostOutcome
HostReply
The pairing device’s answer to a proven join.
JoinerAck
The joiner’s last frame: whether it stored what it was sent.
KeyPurpose

Constants§

CODE_WORDS
IO_TIMEOUT
JOIN_PENDING_FILE
A file in the data dir that sb setup writes before the daemon first starts when the user chose to join an identity. The daemon reads it once at start: an empty store waits for its bootstrap instead of ingesting.
MAX_WRONG_TRIES
Wrong codes a listener takes before it retires its code for a new one.
PAIR_LIFETIME
How long sb pair keeps a listener open.
PAIR_PORT
The pairing listener’s port when nothing else holds it.

Functions§

fetch_keys
Dials a device running sb pair --restore-keys, proves code and hands the epochs it sends to take, whose outcome that device is told. It returns what take made of them and why the final ack failed, if it did.
join
Dials the pairing device at the first of addresses that answers, proves code, sends request and hands the admission to take, whose outcome the pairing device is told. Once take stored the admission the join stands, so a failed final ack is reported, not returned as an error.
pairing_address
Splits --host into a host to dial and the pairing port: name, user@name, name:port, [v6] or [v6]:port.
reachable
Fails unless something listens at one of addresses. The connection is closed without proving a code, so it costs the listener no try.