The source project of this merge request has been removed.
Fix ssh_handle_key_exchange() timeout
See #311 (closed) for background. But in some case, it's possible to trigger the code in ssh_handle_key_exchange() to move session state directly to SSH_SESSION_STATE_AUTHENTICATED. The exit condition for this function is SSH_SESSION_STATE_AUTHENTICATING though, so when it happens, ssh_handle_key_exchange() will time out eventually.
The fix is to check DH_STATE_FINISHED instead, which should be the case for both AUTHENTICATED and AUTHENTICATION. Suggested by Eshan Kelkar. Tested with the problematic client (trilead-ssh2) and made sure the bad condition happened (and not cause timeout)
Checklist
-
Commits have Signed-off-by:with name/author being identical to the commit author -
Code modified for feature -
Test suite updated with functionality tests -
Test suite updated with negative tests -
Documentation updated
Reviewer's checklist:
-
Any issues marked for closing are addressed -
There is a test suite reasonably covering new functionality or modifications -
Function naming, parameters, return values, types, etc., are consistent and according to CONTRIBUTING.md -
This feature/change has adequate documentation added -
No obvious mistakes in the code