# HG changeset patch # User Matt Johnston # Date 1603030674 -28800 # Node ID 7d8462677355a17d70321c743fd5b9bfe81eeb45 # Parent 6e71440b1e47dc1eac997bdffee4031fd834722e Disallow extra kexinit messages diff -r 6e71440b1e47 -r 7d8462677355 common-kex.c --- a/common-kex.c Sun Oct 18 15:08:54 2020 +0800 +++ b/common-kex.c Sun Oct 18 22:17:54 2020 +0800 @@ -487,6 +487,12 @@ TRACE(("continue recv_msg_kexinit: sent kexinit")) } + /* "Once a party has sent a SSH_MSG_KEXINIT message ... + further SSH_MSG_KEXINIT messages MUST NOT be sent" */ + if (ses.kexstate.recvkexinit) { + dropbear_exit("Unexpected KEXINIT"); + } + /* start the kex hash */ local_ident_len = strlen(LOCAL_IDENT); remote_ident_len = strlen(ses.remoteident);