diff options
author | Matt Johnston <matt@ucc.asn.au> | 2013-04-14 23:16:16 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2013-04-14 23:16:16 +0800 |
commit | ef151888fbef7f33f2140da579945b7fcb83151c (patch) | |
tree | 12a1b34f5364eb86d38ed24f9c6db59bf4a0d7f0 /process-packet.c | |
parent | ba15bbfe33f4d6174526a03fda1b3b543a0b1d12 (diff) |
requirenext fixup for firstkexfollows
Diffstat (limited to 'process-packet.c')
-rw-r--r-- | process-packet.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; } } |