From 8406eaf9d5803bf5d5896220134de398aec6fb56 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 21 Nov 2001 22:06:53 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@1390 cda61777-01e9-0310-a592-d414129be87e --- ssh.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ssh.c b/ssh.c index 9b16d83b..7943d071 100644 --- a/ssh.c +++ b/ssh.c @@ -3500,15 +3500,6 @@ static int do_ssh2_transport(unsigned char *in, int inlen, int ispkt) } /* - * 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.) */ @@ -3531,6 +3522,15 @@ static int do_ssh2_transport(unsigned char *in, int inlen, int ispkt) 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. */ cscipher = cscipher_tobe; -- 2.11.0