SshStrictKex¶
The OpenSSH strict key-exchange extension (Terrapin / CVE-2023-48795 mitigation). Each side advertises a role-specific marker as a pseudo key-exchange algorithm in its first KEXINIT only. When both sides advertise it, strict KEX is in effect: the packet sequence number is reset to zero at every NEWKEYS, and no non-key-exchange packets are tolerated during the initial key exchange. The marker is appended last so it never wins negotiation against a real algorithm.
Constructors¶
create¶
Returns¶
- SshStrictKex val^
Public Functions¶
client_marker¶
Returns¶
- String val
server_marker¶
Returns¶
- String val
our_marker¶
The marker this side advertises, by role.
Parameters¶
- role: SshRole
Returns¶
- String val
initial_kexinit_position_ok¶
Under strict KEX the peer's KEXINIT must be the very first binary packet of the connection. The reader increments its sequence number as each packet is read, so when we process that KEXINIT the reader's sequence number is exactly 1 if nothing preceded it. A larger value means a packet was injected before the KEXINIT (e.g. an SSH_MSG_IGNORE) — the pre-KEXINIT half of the Terrapin attack (CVE-2023-48795) — and the connection must abort.
Parameters¶
- reader_sequence_after_read: U32 val
Returns¶
- Bool val
peer_advertised¶
True if the peer's KEXINIT advertised the strict-KEX marker for its role. We always advertise ours, so — since strict KEX requires both sides — this is exactly whether strict KEX is in effect for the connection.
Parameters¶
Returns¶
- Bool val
eq¶
Parameters¶
- that: SshStrictKex val
Returns¶
- Bool val
ne¶
Parameters¶
- that: SshStrictKex val
Returns¶
- Bool val