aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-01-04 16:59:54 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2011-01-04 16:59:54 +0100
commitfdffa42c0259f35e80ad37661d7ae48f2138f3a9 (patch)
tree345ec3cb1a3d32f7bbe5c7403f3425bdc3197f48 /src
parentd679d5d7ef0171d77c26cfe2c1c740b330231770 (diff)
downloadlibssh-fdffa42c0259f35e80ad37661d7ae48f2138f3a9.tar.gz
libssh-fdffa42c0259f35e80ad37661d7ae48f2138f3a9.tar.xz
libssh-fdffa42c0259f35e80ad37661d7ae48f2138f3a9.zip
Fix "SSH_KEXINIT received in wrong state" race
Setting the flag before doing any IO
Diffstat (limited to 'src')
-rw-r--r--src/client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c
index f456e0de..dd63a2be 100644
--- a/src/client.c
+++ b/src/client.c
@@ -524,9 +524,9 @@ static void ssh_client_connection_callback(ssh_session session){
session->socket_callbacks.data=ssh_packet_socket_callback1;
#endif
ssh_packet_set_default_callbacks(session);
+ session->session_state=SSH_SESSION_STATE_INITIAL_KEX;
ssh_send_banner(session, 0);
set_status(session, 0.5f);
- session->session_state=SSH_SESSION_STATE_INITIAL_KEX;
break;
case SSH_SESSION_STATE_INITIAL_KEX:
/* TODO: This state should disappear in favor of get_key handle */