summaryrefslogtreecommitdiffhomepage
path: root/cli-session.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-04-03 00:32:55 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-04-03 00:32:55 +0800
commit78fbed8c3eda1d7f3e0ffa41b54cd3c6ae31a0fe (patch)
tree79a3875e37e1a82c31b89a7b0f4f6410c8423355 /cli-session.c
parentf267ca1f3a51a465ee98d0cfd230c40ddfeda332 (diff)
Don't usually need to recalculate dh_e for the repeated kexdh_init packet
--HG-- branch : kexguess
Diffstat (limited to 'cli-session.c')
-rw-r--r--cli-session.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cli-session.c b/cli-session.c
index 600827f..9e64281 100644
--- a/cli-session.c
+++ b/cli-session.c
@@ -182,6 +182,11 @@ static void cli_sessionloop() {
TRACE2(("enter cli_sessionloop"))
+ if (ses.lastpacket == 0) {
+ TRACE2(("exit cli_sessionloop: no real packets yet"))
+ return;
+ }
+
if (ses.lastpacket == SSH_MSG_KEXINIT && cli_ses.kex_state == KEX_NOTHING) {
/* We initiate the KEXDH. If DH wasn't the correct type, the KEXINIT
* negotiation would have failed. */
@@ -206,10 +211,9 @@ static void cli_sessionloop() {
return;
}
- /* We should exit if we haven't donefirstkex: we shouldn't reach here
- * in normal operation */
if (ses.kexstate.donefirstkex == 0) {
- TRACE(("XXX XXX might be bad! leave cli_sessionloop: haven't donefirstkex"))
+ /* We might reach here if we have partial packet reads or have
+ * received SSG_MSG_IGNORE etc. Just skip it */
return;
}