Expand description
Typed connection-multiplexing configuration and wire primitives.
This module deliberately contains no CLI, dispatcher, or live SSH runtime integration. It is the policy and protocol boundary those layers use.
Structs§
- Attached
Session - Control
Data - Ordered session data or EOF indication.
- Control
Path Context - Deterministic values used to expand an OpenSSH
ControlPathtemplate. - Control
Policy - Typed view over the three string-valued fields currently stored in
SshHostConfig. - Control
Request - Correlated client-to-master request.
- Control
Response - Correlated master-to-client response.
- Control
Socket Guard - Running
Control Master - Session
Open Request - Session policy transferred to the authenticated control master.
Enums§
- Attach
Outcome - Control
Command - Commands accepted by OpenSSH-compatible
-Ocontrol handling. - Control
Config Error - Invalid user-authored control configuration.
- Control
Data Stream - Byte stream represented by a data message.
- Control
Master Mode - OpenSSH
ControlMasterconnection-selection policy. - Control
Message - One framed message on a bssh control socket.
- Control
Operation - Request operation understood by a bssh control master.
- Control
Path Error - Invalid or unrepresentable
ControlPathvalues. - Control
Persist - Lifetime policy for an idle multiplexing master.
- Control
Protocol Error - Framing, serialization, version, or semantic-limit failure.
- Control
Response Kind - Result variants needed by #286’s session and five control commands.
Constants§
- CONTROL_
PROTOCOL_ VERSION - Version of bssh’s length-prefixed JSON multiplexing protocol.
- MAX_
CONTROL_ DATA_ BYTES - Largest binary chunk carried in one data message.
- MAX_
CONTROL_ FRAME_ BYTES - Largest accepted serialized control message.
Functions§
- attach_
session - bind_
control_ socket - Bind with a private temporary pathname, chmod it before publication, and hard-link it into place. No client can reach the socket while its mode is broader than 0600.
- connect_
control_ socket - expand_
control_ path - Expand the #286 ControlPath token subset and validate the resulting Unix socket address before any connection or bind attempt.
- prepare_
attached_ session - Complete the hello and OpenSession exchange without starting local I/O.
Callers implementing
-fmay safely detach after this returns because the master has authenticated the control peer and accepted the session. - read_
control_ message - Read, decode, and validate one bounded big-endian-length-prefixed JSON message without allocating an attacker-declared oversized frame.
- remove_
stale_ control_ socket - Remove a refused socket only when it is still the exact same socket owned by this uid. Regular files, symlinks, replacement sockets, and foreign sockets are never removed.
- send_
control_ command - start_
control_ master - start_
control_ master_ with_ bootstrap_ session - Start a master and optionally let its own initial foreground passenger
attach without an
askprompt. Subsequent shared sessions still honorrequire_confirmation. - unix_
socket_ path_ capacity - Number of bytes in
sockaddr_un.sun_path, including its terminating NUL. Non-Unix targets returnNoneand remain compile-safe without claiming Unix-domain socket support. - validate_
control_ socket_ path - Validate an already-expanded control socket path.
- verify_
same_ user - write_
control_ message - Serialize and write one bounded big-endian-length-prefixed JSON message.