SshKexStateMachine¶
Constructors¶
create¶
Parameters¶
- role: SshRole
Returns¶
- SshKexStateMachine ref^
Public Functions¶
generate_kexinit¶
Generate our SSH_MSG_KEXINIT payload with a random 16-byte cookie. Errors if the CSPRNG fails. When include_strict_marker is set (only the first KEXINIT of a connection), the strict-KEX marker for our role is advertised.
fun ref generate_kexinit(
prefs: SshAlgorithmPreferences val,
include_strict_marker: Bool val = false)
: Array[U8 val] val ?
Parameters¶
- prefs: SshAlgorithmPreferences val
- include_strict_marker: Bool val = false
Returns¶
receive_kexinit¶
Parse their KEXINIT, negotiate algorithms.
fun ref receive_kexinit(
their_payload: Array[U8 val] val,
our_prefs: SshAlgorithmPreferences val)
: (SshNegotiatedAlgorithms val | SshTransportError)
Parameters¶
- their_payload: Array[U8 val] val
- our_prefs: SshAlgorithmPreferences val
Returns¶
derive_keys¶
Derive encryption keys per RFC 4253 section 7.2. Errors if the underlying SHA-256 computation fails (rather than producing zero-filled keys).
Each key is: HASH(K || H || X || session_id) where K = shared secret (mpint), H = exchange hash, X = single letter.
fun ref derive_keys(
shared_secret: Array[U8 val] val,
exchange_hash: Array[U8 val] val,
session_id: Array[U8 val] val,
negotiated: SshNegotiatedAlgorithms val)
: SshDerivedKeys val ?
Parameters¶
- shared_secret: Array[U8 val] val
- exchange_hash: Array[U8 val] val
- session_id: Array[U8 val] val
- negotiated: SshNegotiatedAlgorithms val
Returns¶
- SshDerivedKeys val ?