From ef151888fbef7f33f2140da579945b7fcb83151c Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Sun, 14 Apr 2013 23:16:16 +0800 Subject: requirenext fixup for firstkexfollows --- process-packet.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'process-packet.c') diff --git a/process-packet.c b/process-packet.c index 128eb72..3ac0c1b 100644 --- a/process-packet.c +++ b/process-packet.c @@ -74,14 +74,15 @@ void process_packet() { /* This applies for KEX, where the spec says the next packet MUST be * NEWKEYS */ - if (ses.requirenext != 0) { - if (ses.requirenext != type) { - /* TODO send disconnect? */ + if (ses.requirenext[0] != 0) { + if (ses.requirenext[0] != type + && (ses.requirenext[1] == 0 || ses.requirenext[1] != type)) { dropbear_exit("Unexpected packet type %d, expected %d", type, ses.requirenext); } else { /* Got what we expected */ - ses.requirenext = 0; + ses.requirenext[0] = 0; + ses.requirenext[1] = 0; } } -- cgit v1.2.3