Skip to content

Specify that group-exchange is unsupported for server, and don't use it as a default - #1512

Open
roy-trgscreen wants to merge 2 commits into
mscdex:masterfrom
roy-trgscreen:patch-1
Open

Specify that group-exchange is unsupported for server, and don't use it as a default#1512
roy-trgscreen wants to merge 2 commits into
mscdex:masterfrom
roy-trgscreen:patch-1

Conversation

@roy-trgscreen

Copy link
Copy Markdown

When running as server, and having a group-exchange kex in your list, kex negotiation can fail even if there is a compatible one, as the server will advertise supporting diffie-hellman-group-exchange-sha256, but then after it was chosen authentication will fail, even if there are lower priority kex options that would work (as group-exchange is not implemented for the server:

ssh2/lib/protocol/kex.js

Lines 1439 to 1446 in a3a39d7

// TODO: allow user implementation to provide safe prime and
// generator on demand to support group exchange on server side
return doFatalError(
this._protocol,
'Group exchange not implemented for server',
'handshake',
DISCONNECT_REASON.KEY_EXCHANGE_FAILED
);
#1158).

Clarify that certain algorithms are not supported when running as server, and also not choose them by default.

I would potentially even go as far as to filter out user-specified -group-exhange- options so users don't fall into the same trap as I did.

@roy-trgscreen roy-trgscreen changed the title Specify that group-exchange is unsupported for server Specify that group-exchange is unsupported for server, and don't use it as a default Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant