diff common-kex.c @ 1681:435cfb9ec96e

send and handle SSH_MSG_EXT_INFO only at the correct point - other fixes for rsa pubkey auth - only include ext-info handling when rsa pubkey auth is compiled
author Matt Johnston <matt@ucc.asn.au>
date Sun, 24 May 2020 14:16:58 +0800
parents 4b4cfc92c5b7
children 41bf8f216644
line wrap: on
line diff
--- a/common-kex.c	Sun May 24 13:34:19 2020 +0800
+++ b/common-kex.c	Sun May 24 14:16:58 2020 +0800
@@ -175,6 +175,9 @@
 	
 	/* set up our state */
 	ses.kexstate.sentnewkeys = 1;
+	if (ses.kexstate.donefirstkex) {
+		ses.kexstate.donesecondkex = 1;
+	}
 	ses.kexstate.donefirstkex = 1;
 	ses.dataallowed = 1; /* we can send other packets again now */
 	gen_new_keys();
@@ -197,8 +200,6 @@
 
 /* Set up the kex for the first time */
 void kexfirstinitialise() {
-	ses.kexstate.donefirstkex = 0;
-
 #ifdef DISABLE_ZLIB
 	ses.compress_algos = ssh_nocompress;
 #else
@@ -833,6 +834,7 @@
 	}
 #endif
 
+#if DROPBEAR_EXT_INFO
 	/* Determine if SSH_MSG_EXT_INFO messages should be sent.
 	Should be done for the first key exchange. Only required on server side
     for server-sig-algs */
@@ -843,6 +845,7 @@
 			}
 		}
 	}
+#endif
 
 	algo = buf_match_algo(ses.payload, sshkex, kexguess2, &goodguess);
 	allgood &= goodguess;