summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/kex.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-04-04 22:04:36 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-04-04 22:04:36 +0000
commit200c8f588f60837a0ac1122ea9cf403b77f3f8a4 (patch)
tree01010d31506fd5ea6e67acf3990b3d24dfbce5f3 /usr.bin/ssh/kex.c
parent1b1a009c606297619e8ab2b15a5e557cd5cde7e5 (diff)
parse full kexinit packet.
make server-side more robust, too.
Diffstat (limited to 'usr.bin/ssh/kex.c')
-rw-r--r--usr.bin/ssh/kex.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/ssh/kex.c b/usr.bin/ssh/kex.c
index da9c56eb0ab..0720c073d4e 100644
--- a/usr.bin/ssh/kex.c
+++ b/usr.bin/ssh/kex.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: kex.c,v 1.30 2001/04/04 20:25:37 markus Exp $");
+RCSID("$OpenBSD: kex.c,v 1.31 2001/04/04 22:04:34 markus Exp $");
#include <openssl/crypto.h>
@@ -166,6 +166,7 @@ kex_input_kexinit(int type, int plen, void *ctxt)
{
char *ptr;
int dlen;
+ int i;
Kex *kex = (Kex *)ctxt;
debug("SSH2_MSG_KEXINIT received");
@@ -175,6 +176,15 @@ kex_input_kexinit(int type, int plen, void *ctxt)
ptr = packet_get_raw(&dlen);
buffer_append(&kex->peer, ptr, dlen);
+ /* discard packet */
+ for (i = 0; i < KEX_COOKIE_LEN; i++)
+ packet_get_char();
+ for (i = 0; i < PROPOSAL_MAX; i++)
+ xfree(packet_get_string(NULL));
+ packet_get_char();
+ packet_get_int();
+ packet_done();
+
kex_kexinit_finish(kex);
}