-
-
Notifications
You must be signed in to change notification settings - Fork 900
Handle SSH servers that send success response out of spec order #1786
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
base: master
Are you sure you want to change the base?
Conversation
I'm assuming you're doing In theory phpseclib should request a second binary packet when it encounters a window adjust channel packet: phpseclib/phpseclib/Net/SSH2.php Lines 3719 to 3725 in 3e073a5
That's from the phpseclib/phpseclib/Net/SSH2.php Lines 4284 to 4289 in 3e073a5
Consequently, the change you made shouldn't be necessary. If the code I've mentioned isn't working then that may indicate other problems that this change kinda sweeps under the rug. |
I'd still love to see log files! Like I discussed in my last post the concern I have with your PR is that there's already code in place that should deal with the situation you're describing and if that's not working then that's quite potentially a harbinger for other issues that your fix wouldn't address. Thanks! |
That's correct, I do this to determine the host line (the part that gets output when you put a few empty lines in) and differentiate that from the MOTD/any broadcast messages.
Wasn't sure if there was anything sensitive in there, so I've sent via email. |
I tried to "replay" the logs you gave me without success. That's not exactly an exact science however. In light of my inability to reproduce them... maybe you could try this?:
You can turn off logging and just run it with those changes. They won't fix anything but it'll at least tell me if that block of code is being called. We can proceed from there. Thanks! |
Try doing this too:
|
There are some Juniper switches that have a (maybe incorrect?) implementation of the SSH spec which send back a SUCCESS response at a time this lib does not expect it. This causes the lib to bail out immediately. This patch ensures that when this unexpected SSH response comes back, we just continue operations as usual.
Here's the last bit of the SSH debug output when this behavior was happening: