]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pgsql: don't fail if proto parses unknown message
authorJuliana Fajardini <jufajardini@gmail.com>
Fri, 7 Feb 2025 21:40:08 +0000 (18:40 -0300)
committerVictor Julien <victor@inliniac.net>
Wed, 19 Feb 2025 08:21:37 +0000 (09:21 +0100)
Even if unknown, if the message is properly parsed, allow the parser to
proceed.

Related to
Bug #5524

rust/src/pgsql/pgsql.rs

index db57fe1e090dc5e5d8bc2398650ae81ab363f762..e9356ad45677b66551a0a3f127345a0ef21517fc 100644 (file)
@@ -632,10 +632,7 @@ unsafe extern "C" fn probing_parser_ts(
         let slice: &[u8] = build_slice!(input, input_len as usize);
 
         match parser::parse_request(slice) {
-            Ok((_, request)) => {
-                if let PgsqlFEMessage::UnknownMessageType(_) = request {
-                    return ALPROTO_FAILED;
-                }
+            Ok((_, _)) => {
                 return ALPROTO_PGSQL;
             }
             Err(Err::Incomplete(_)) => {
@@ -661,10 +658,7 @@ unsafe extern "C" fn probing_parser_tc(
         }
 
         match parser::pgsql_parse_response(slice) {
-            Ok((_, response)) => {
-                if let PgsqlBEMessage::UnknownMessageType(_) = response {
-                    return ALPROTO_FAILED;
-                }
+            Ok((_, _)) => {
                 return ALPROTO_PGSQL;
             }
             Err(Err::Incomplete(_)) => {