-
Notifications
You must be signed in to change notification settings - Fork 18k
x/crypto/ssh: ssh_message_ignore (message type 2) causing an error on Dial() #16927
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
Comments
We're running into this server-side as well. The issue appears to be that in the handshake transport, it's not ignored properly, as during the handshake, there are multiple messages exchanged in a specific order. However, it looks like it's valid for msgIgnore to come between those. At the end of |
There is one caveat in that the requirement to accept this message type is only levied after the identification string is sent which should happen after the connection is established. I don't think that is the case here since the message type it is expecting is related to key exchanging. Key exchange comes after the identification string has been sent. |
I'm not as familiar with this part of the protocol (yet) but it seems like the identification string is always the first line sent and it's not a part of a packet. So, anywhere packets are sent and received, msgIgnore can show up. |
I feel like it should be fine to ignore msgIgnore at the transport level... unless there's any pressing need, couldn't Or does that mean other stuff has to be refactored because we translate messages into msgIgnore to drop them in at least one instance. |
you should be able to drop in the code that decrypts a packet. |
I encounter the same issue when I use crypto/ssh for client side.
I feel it was a good suggestion, had voted +1.
could you explain more? |
It looks like this should have been closed a few days ago. golang/crypto@7c6cc32 |
This prevents these messages from confusing higher layers of the protocol. Fixes golang#16927. Change-Id: If18d8d02bdde3c0470e29a7280cd355d3e55ad78 Reviewed-on: https://go-review.googlesource.com/34959 Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
What version of Go are you using (
go version
)?go1.7 darwin/amd64
What operating system and processor architecture are you using (
go env
)?darwin, amd64
What did you do?
attempted to connect to an ssh server via /x/crypto/ssh using ssh.Dial()
What did you expect to see?
A successful connection.
What did you see instead?
unexpected message type 2 (expected one of [31])
RFC4253 states "all implementations must understand and subsequently ignore this message at any time" but the package is treating it as an invalid message type, causing the transmission attempt to fail. (see https://tools.ietf.org/html/rfc4253#page-26)
The text was updated successfully, but these errors were encountered: