Skip to main content

Module pairing

Module pairing 

Source
Expand description

Pairing devices with a short code: the DM’s device (“host”) and a new device (“joiner”) run the PAKE in edda_auth::pairing, relayed by the auth service.

host                         relay                         joiner
 | POST /pairings  ─────────▶  slot 7
 | shows 7-tavern-dragon                   (told the code out loud)
 |                                ◀────────── joiner/0: SPAKE2 message
 | host/0: SPAKE2 message ──────▶
 |                                ◀────────── joiner/1: sealed {key, name}
 | opens it (or cancels: wrong code), asks the DM, adds the device
 | host/1: sealed {campaign, server key, certificate} ─▶

Structs§

Invitation
A code the host can hand out.
Joined
What a joiner gets out of a successful pairing.

Enums§

PairError
What can go wrong pairing a device.

Functions§

host
The host’s side: waits for someone to join with invitation’s code, asks approve about them, and if approved admits them to the campaign. dm must be logged in as the DM device key.
join
The joiner’s side: pairs key using a code from the DM. On success the device is in the campaign and can log in.