-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/crypto: SSH swallows first character in second connection #41390
Comments
/cc @FiloSottile @hanwen |
can you reproduce this if you don't use the ssh/terminal package? |
@hanwen How do you mean? If I remove the Without extra enter:
With an extra enter before the second "hi":
In the end, I need everything in the current version:
The same workflow works perfectly with the OpenSSH client, as far as I can come close to reproduce this. |
the question is whether the SSH package swallows a byte somewhere at the transport level (unlikely), or if there is a problem with the terminal layering that runs on top of the SSH package. |
As per my last comment, I believe I was able to reproduce a variation of the bug without using the terminal module. This is the code I used: xcrypto-noterm-bug.txt |
@jkohen @hanwen |
Hi! My symptoms are: If input after connecting with ssh shell(), the key is randomly chewed(swallowed). I'd like to know how to fix it, but there is only one reference here related to the issue. 😥 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The following assumes a ssh server in localhost set up with SSH_AUTH_SOCK, which is what my environment provides. It should be trivial for you all to adjust it for a different host and hardcoded password as needed:
What did you expect to see?
The output from the second session is exactly what I entered on the keyboard.
What did you see instead?
The output from the second session is missing the first character. If I add more executions of runTest(), I see the same effect in all but the first session.
For instance, in the session below I typed "hi" both times, but the second time only the "i" was registered:
I tried a few things to no avail:
TerminalMode
settings.os.Stdin.Sync()
andos.Stdin.Seek(0, 2)
I also tried a couple different versions of the SSH code in the snippet, and always got the same result. I was unable to reproduce this with a local shell, or with the ssh command-line tool (OpenSSH).
The text was updated successfully, but these errors were encountered: