comparison common-kex.c @ 1743:7d8462677355 fuzz

Disallow extra kexinit messages
author Matt Johnston <matt@ucc.asn.au>
date Sun, 18 Oct 2020 22:17:54 +0800
parents 8f93f37c01de
children 3bfacfc996cf
comparison
equal deleted inserted replaced
1742:6e71440b1e47 1743:7d8462677355
485 /* we need to send a kex packet */ 485 /* we need to send a kex packet */
486 send_msg_kexinit(); 486 send_msg_kexinit();
487 TRACE(("continue recv_msg_kexinit: sent kexinit")) 487 TRACE(("continue recv_msg_kexinit: sent kexinit"))
488 } 488 }
489 489
490 /* "Once a party has sent a SSH_MSG_KEXINIT message ...
491 further SSH_MSG_KEXINIT messages MUST NOT be sent" */
492 if (ses.kexstate.recvkexinit) {
493 dropbear_exit("Unexpected KEXINIT");
494 }
495
490 /* start the kex hash */ 496 /* start the kex hash */
491 local_ident_len = strlen(LOCAL_IDENT); 497 local_ident_len = strlen(LOCAL_IDENT);
492 remote_ident_len = strlen(ses.remoteident); 498 remote_ident_len = strlen(ses.remoteident);
493 499
494 kexhashbuf_len = local_ident_len + remote_ident_len 500 kexhashbuf_len = local_ident_len + remote_ident_len