]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rdp: fix incomplete result
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 1 Oct 2020 07:54:13 +0000 (09:54 +0200)
committerJason Ish <jason.ish@oisf.net>
Wed, 7 Oct 2020 15:40:38 +0000 (09:40 -0600)
Aggregating the consumed bytes

rust/src/rdp/rdp.rs

index 4a2c034dda5fb5bb3284bab4c7cb2723e2b2bb43..fac136b6e3e51169ec7f590243113bc1ee315915 100644 (file)
@@ -245,7 +245,14 @@ impl RdpState {
                     Err(nom::Err::Failure(_)) | Err(nom::Err::Error(_)) => {
                         if probe_tls_handshake(available) {
                             self.tls_parsing = true;
-                            return self.parse_ts(available);
+                            let r = self.parse_ts(available);
+                            if r.status == 1 {
+                                //adds bytes already consumed to incomplete result
+                                let consumed = (input.len() - available.len()) as u32;
+                                return AppLayerResult::incomplete(r.consumed + consumed, r.needed);
+                            } else {
+                                return r;
+                            }
                         } else {
                             return AppLayerResult::err();
                         }