Don't usually need to recalculate dh_e for the repeated kexdh_init packet

--HG--
branch : kexguess
This commit is contained in:
Matt Johnston
2013-04-03 00:32:55 +08:00
parent f267ca1f3a
commit 78fbed8c3e
5 changed files with 25 additions and 10 deletions

View File

@@ -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;
}