1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Send SSH2_MSG_NEWKEYS _before_ expecting to receive it, rather than

after. Shouldn't make a difference for any server that previously
worked, but we should now interoperate sensibly with servers that
wait to receive our NEWKEYS before sending their own. Apparently
Unisphere produce one such.

[originally from svn r1390]
This commit is contained in:
Simon Tatham 2001-11-21 22:06:53 +00:00
parent f176cbe70f
commit 15517300d8

18
ssh.c
View File

@ -3499,15 +3499,6 @@ static int do_ssh2_transport(unsigned char *in, int inlen, int ispkt)
crReturn(0);
}
/*
* Expect SSH2_MSG_NEWKEYS from server.
*/
crWaitUntil(ispkt);
if (pktin.type != SSH2_MSG_NEWKEYS) {
bombout(("expected new-keys packet from server"));
crReturn(0);
}
/*
* Authenticate remote host: verify host key. (We've already
* checked the signature of the exchange hash.)
@ -3530,6 +3521,15 @@ static int do_ssh2_transport(unsigned char *in, int inlen, int ispkt)
ssh2_pkt_init(SSH2_MSG_NEWKEYS);
ssh2_pkt_send();
/*
* Expect SSH2_MSG_NEWKEYS from server.
*/
crWaitUntil(ispkt);
if (pktin.type != SSH2_MSG_NEWKEYS) {
bombout(("expected new-keys packet from server"));
crReturn(0);
}
/*
* Create and initialise session keys.
*/