1
0
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:
Aris Adamantiadis
2011-01-04 16:59:54 +01:00
parent d679d5d7ef
commit fdffa42c02

View File

@@ -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 */