Skip to main content

Module session

Module session 

Source
Available on crate feature rustcrypto only.
Expand description

Secure sessions: what PASE and CASE produce, and what every later message rides on (Core §4.13).

A session is a pair of directional keys plus the bookkeeping that makes them safe to use: a counter that never repeats, a replay window for the peer’s counters, and the identity the peer proved. Both PASE and CASE end by installing one.

§Directional keys, and the trap in them

Session establishment produces two keys — I2RKey for initiator-to-responder and R2IKey for the other way — and which one a node encrypts with depends on which end it was. §4.14.1: “The initiator SHALL use I2RKey to encrypt … and the R2IKey to decrypt … The responder SHALL use R2IKey to encrypt … and the I2RKey to decrypt.”

Getting that backwards produces a node that cannot talk to anything and can talk perfectly to itself, so it survives every test written against another instance of the same bug. SecureSession::encrypt_keys and SecureSession::decrypt_keys pick from the recorded Role, so the choice is made once, in one place.

Structs§

EstablishedKeys
The three keys session establishment derives (§4.14.1, §4.14.2.7).
SecureSession
One established secure session (§4.13.2).
SessionTable
The fixed-capacity set of established sessions.

Enums§

Role
Which end of session establishment this node was.
SessionKind
How a session was established.

Constants§

SESSION_KEYS_INFO
SEKeys_Info — “SessionKeys” (Core §4.14.1, §4.14.2.7).