-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-445: OpenSSH "strict KEX" protocol extension
Implements the OpenSSH "strict KEX" protocol extension.[1] If both parties in a an SSH connection announce support for strict KEX in the initial KEX_INIT message, strict KEX is active; otherwise it isn't. With strict KEX active, there must be only KEX-related messages during the initial key exchange (no IGNORE or DEBUG messages are allowed), and the KEX_INIT message must be the first one to have been received after the initial version exchange. If these conditions are violated, the connection is terminated. Strict KEX also resets message sequence numbers to zero after each NEW_KEYS message sent or received. [1] https://github.com/openssh/openssh-portable/blob/master/PROTOCOL
- Loading branch information
Showing
6 changed files
with
213 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,9 +59,23 @@ public final class KexExtensions { | |
public static final String CLIENT_KEX_EXTENSION = "ext-info-c"; | ||
public static final String SERVER_KEX_EXTENSION = "ext-info-s"; | ||
|
||
@SuppressWarnings("checkstyle:Indentation") | ||
public static final Predicate<String> IS_KEX_EXTENSION_SIGNAL | ||
= n -> CLIENT_KEX_EXTENSION.equalsIgnoreCase(n) || SERVER_KEX_EXTENSION.equalsIgnoreCase(n); | ||
public static final Predicate<String> IS_KEX_EXTENSION_SIGNAL = // | ||
n -> CLIENT_KEX_EXTENSION.equalsIgnoreCase(n) || SERVER_KEX_EXTENSION.equalsIgnoreCase(n); | ||
|
||
/** | ||
* Reminder: | ||
* | ||
* These pseudo-algorithms are only valid in the initial SSH2_MSG_KEXINIT and MUST be ignored if they are present in | ||
* subsequent SSH2_MSG_KEXINIT packets. | ||
* | ||
* <B>Note:</B> these values are <U>appended</U> to the initial proposals and removed if received before proceeding | ||
* with the standard KEX proposals negotiation. | ||
* | ||
* @see <A HREF="https://github.com/openssh/openssh-portable/blob/master/PROTOCOL">OpenSSH PROTOCOL - 1.9 transport: | ||
* strict key exchange extension</A> | ||
*/ | ||
public static final String STRICT_KEX_CLIENT_EXTENSION = "[email protected]"; | ||
public static final String STRICT_KEX_SERVER_EXTENSION = "[email protected]"; | ||
|
||
/** | ||
* A case <U>insensitive</U> map of all the default known {@link KexExtensionParser} where key=the extension name | ||
|
Oops, something went wrong.