pub struct NonceLog { /* private fields */ }Expand description
A record of already used pairing nonces, used to reject replays.
§What it protects against
The pairing protocol already makes each session single-use (PendingSession::accept takes
self, and every begin generates a fresh ephemeral key and nonce). This record covers the
layer above: a caller that persists nonces can still recognise “this QR code / this session has
already been handled” after a restart, instead of accepting it again because in-memory
state was lost.
§Bounded capacity
Pairing happens at the pace of manual user actions, so a few hundred entries are plenty. An unbounded record would be a resource an attacker could exhaust by starting pairings it never finishes. When the record is full the oldest entry is evicted; the session behind an evicted nonce ended long ago, so replaying it could not succeed anyway.