mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
requirenext fixup for firstkexfollows
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user