Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/src/algorithm/ssh_kex_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ class SSHKexType extends SSHAlgorithm {
digestFactory: digestSha256,
);

/// RFC 8731 name for the same algorithm as [x25519]. Servers hardened to a
/// single kex commonly offer only this spelling, and OpenSSH matches names
/// literally — without it the handshake dies with "no matching key exchange
/// method found".
static const x25519Rfc = SSHKexType._(
name: 'curve25519-sha256',
digestFactory: digestSha256,
);

static const nistp256 = SSHKexType._(
name: 'ecdh-sha2-nistp256',
digestFactory: digestSha256,
Expand Down
1 change: 1 addition & 0 deletions lib/src/ssh_algorithm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class SSHAlgorithms {
const SSHAlgorithms({
this.kex = const [
SSHKexType.x25519,
SSHKexType.x25519Rfc,
SSHKexType.nistp521,
SSHKexType.nistp384,
SSHKexType.nistp256,
Expand Down
1 change: 1 addition & 0 deletions lib/src/ssh_transport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ class SSHTransport {

switch (_kexType) {
case SSHKexType.x25519:
case SSHKexType.x25519Rfc:
_kex = await SSHKexX25519.createAsync();
break;
case SSHKexType.nistp256:
Expand Down
1 change: 1 addition & 0 deletions test/src/algorithm/ssh_cipher_type_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void main() {
algorithms.kex,
equals([
SSHKexType.x25519,
SSHKexType.x25519Rfc,
SSHKexType.nistp521,
SSHKexType.nistp384,
SSHKexType.nistp256,
Expand Down