Skip to main content

Module session

Module session 

Source
Expand description

The channel of a signed exec session, without any network code.

  1. The enforcer sends a Challenge: a fresh nonce and an ephemeral X25519 key for this session.
  2. The engineer’s device signs a session/v1 statement naming that nonce, that key and the client’s own ephemeral key.
  3. Both sides run Noise_KK_25519_ChaChaPoly_SHA256 with the two keys, bound to the statement’s digest, so the session is the one that was signed. Every later frame is encrypted and numbered: whoever relays the frames reads nothing, and a frame it injects, drops, reorders or replays fails to decrypt.
  4. The enforcer appends every frame to a hash-chained Transcript.

Structs§

Challenge
What the enforcer sends first.
Channel
An encrypted, numbered channel.
Handshake
One side of the handshake, before it completes.
SessionBody
session/v1: one exec session.
SessionChallenge
What the enforcer handed out for one session request.
SessionKeys
An X25519 key pair for one session.
SessionTarget
What a session runs.
Transcript
A hash-chained transcript of one session.
TranscriptEntry
One transcript entry. Each names the hash of the one before, so an entry that is removed or changed breaks the chain.

Enums§

Direction
Direction of a transcript entry.
FrameKind
What one frame carries.
Side
Which side of the channel this is.

Constants§

MAX_FRAME_PAYLOAD
Plaintext room in one Noise message, after the tag and the frame kind.
MAX_SESSION_SECONDS
Longest exec session a statement may allow.
NONCE_LIFETIME_SECONDS
How long a challenge’s nonce stays usable.

Functions§

verify_transcript
Check that entries form one unbroken chain from the statement.