mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
Fix "SSH_KEXINIT received in wrong state" race
Setting the flag before doing any IO
This commit is contained in:
@@ -524,9 +524,9 @@ static void ssh_client_connection_callback(ssh_session session){
|
|||||||
session->socket_callbacks.data=ssh_packet_socket_callback1;
|
session->socket_callbacks.data=ssh_packet_socket_callback1;
|
||||||
#endif
|
#endif
|
||||||
ssh_packet_set_default_callbacks(session);
|
ssh_packet_set_default_callbacks(session);
|
||||||
|
session->session_state=SSH_SESSION_STATE_INITIAL_KEX;
|
||||||
ssh_send_banner(session, 0);
|
ssh_send_banner(session, 0);
|
||||||
set_status(session, 0.5f);
|
set_status(session, 0.5f);
|
||||||
session->session_state=SSH_SESSION_STATE_INITIAL_KEX;
|
|
||||||
break;
|
break;
|
||||||
case SSH_SESSION_STATE_INITIAL_KEX:
|
case SSH_SESSION_STATE_INITIAL_KEX:
|
||||||
/* TODO: This state should disappear in favor of get_key handle */
|
/* TODO: This state should disappear in favor of get_key handle */
|
||||||
|
|||||||
Reference in New Issue
Block a user