]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
ssh: fix incomplete return for ssh kex
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 10 Jul 2020 07:40:49 +0000 (09:40 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 10 Jul 2020 13:31:41 +0000 (15:31 +0200)
In the case where we already parsed some records

rust/src/ssh/ssh.rs

index 4bdfe97afbf6c094a99e960740ac9828dff007c1..11201c8f7cf8653c64cf9a200e5f1fe33ad07b51 100644 (file)
@@ -228,8 +228,8 @@ impl SSHState {
                                         // saving type of incomplete kex message
                                         hdr.record_left_msg = parser::MessageCode::SshMsgKexinit;
                                         return AppLayerResult::incomplete(
-                                            SSH_RECORD_HEADER_LEN as u32,
-                                            hdr.record_left as u32
+                                            (il - rem.len()) as u32,
+                                            (head.pkt_len - 2) as u32
                                         );
                                     }
                                     else {