-
-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key exchange negotiation failed when speak to OpenSSH 6.5 and 6.6 #1191
Comments
Here's the test cases: [TestMethod]
[DataRow("OpenSSH_6.5")]
[DataRow("OpenSSH_6.5p1")]
[DataRow("OpenSSH_6.5 PKIX")]
[DataRow("OpenSSH_6.6")]
[DataRow("OpenSSH_6.6p1")]
[DataRow("OpenSSH_6.6 PKIX")]
public void ShouldExcludeCurve25519Kex(string serverSoftwareVersion)
{
ServerIdentification = new SshIdentification("2.0", serverSoftwareVersion);
Assert.IsFalse(ConnectionInfo.KeyExchangeAlgorithms.Keys.Contains("curve25519-sha256"));
Assert.IsFalse(ConnectionInfo.KeyExchangeAlgorithms.Keys.Contains("[email protected]"));
}
[TestMethod]
[DataRow("OpenSSH_6.6.1")]
[DataRow("OpenSSH_6.6.1p1")]
[DataRow("OpenSSH_6.6.1 PKIX")]
[DataRow("OpenSSH_6.7")]
[DataRow("OpenSSH_6.7p1")]
[DataRow("OpenSSH_6.7 PKIX")]
public void ShouldIncludeCurve25519Kex(string serverSoftwareVersion)
{
ServerIdentification = new SshIdentification("2.0", serverSoftwareVersion);
Assert.IsTrue(ConnectionInfo.KeyExchangeAlgorithms.Keys.Contains("curve25519-sha256"));
Assert.IsTrue(ConnectionInfo.KeyExchangeAlgorithms.Keys.Contains("[email protected]"));
} |
I think it would be better to provide a generic solution. Here I propose a new event in |
Sounds good to me. Did you have problems with the previous version of your PR? It seems reasonable to have both |
The previous version of the PR is specific to fix the issue of OpenSSH 6.5/6.6. The updated PR is generic and can potentially benefit to PR #972 |
The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1 |
* Fix sshnet/SSH.NET#1191 * Expose `SshIdentificationReceived` event so that lib consumer can adjust based on server identification * revert unrelated code style change * revert OpenSSH 6.6 related tests * revert ConnectionBase * Add unit tests * Rename to `ServerIdentificationReceived` * rename
OpenSSH 6.5 and 6.6 has a bug that causes ~0.2% of connections using the [email protected] KEX exchange method to fail when connecting with something that implements the spec properly, for instance, SSH.NET
The bug is fixed in OpenSSH 6.6.1 and 6.7 onwards, see openssh/openssh-portable@adbfdbb
They also implemented a compatibility logic in newer OpenSSH so that when newer OpenSSH client speaks to OpenSSH 6.5/6.6, the client will NOT propose
curve25519-sha256
nor[email protected]
key exchange method.Currently, when SSH.NET speaks to OpenSSH 6.5/6.6, ~0.2% of connections will throw below exception:
Options:
curve25519-sha256
and[email protected]
key exchange algorithms when and only when speak to OpenSSH 6.5 and 6.6.event EventHandler<SshIdentificationEventArgs> ServerIdentificationReceived
The text was updated successfully, but these errors were encountered: