mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
Fix ssh_handle_key_exchange() timeout
See libssh-mirror#311 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 straightforward. Tested with the problematic client (trilead-ssh2) and made sure the bad condition happened (and not cause timeout) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
82c8bbc504
commit
168302b9d6
@@ -525,6 +525,7 @@ static int ssh_server_kex_termination(void *s){
|
||||
ssh_session session = s;
|
||||
if (session->session_state != SSH_SESSION_STATE_ERROR &&
|
||||
session->session_state != SSH_SESSION_STATE_AUTHENTICATING &&
|
||||
session->session_state != SSH_SESSION_STATE_AUTHENTICATED &&
|
||||
session->session_state != SSH_SESSION_STATE_DISCONNECTED)
|
||||
return 0;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user