From: Sascha Steinbiss Date: Fri, 30 Jun 2023 08:16:45 +0000 (+0200) Subject: rfb: also set unimplemented auth types X-Git-Tag: suricata-6.0.14~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74cbbd7ef463e01c9faedaee7bcd3272f70889d9;p=thirdparty%2Fsuricata.git rfb: also set unimplemented auth types (cherry picked from commit 1521b77edd04921a9b5f9419f84c62a812315e7a) --- diff --git a/rust/src/rfb/rfb.rs b/rust/src/rfb/rfb.rs index 926ea13614..14219b04b3 100644 --- a/rust/src/rfb/rfb.rs +++ b/rust/src/rfb/rfb.rs @@ -228,6 +228,15 @@ impl RFBState { current = rem; let chosen_security_type = request.security_type; + + if let Some(current_transaction) = self.get_current_tx() { + current_transaction.ts_security_type_selection = Some(request); + current_transaction.chosen_security_type = + Some(chosen_security_type as u32); + } else { + debug_validate_fail!("no transaction set at security type stage"); + } + match chosen_security_type { 2 => self.state = parser::RFBGlobalState::TCVncChallenge, 1 => self.state = parser::RFBGlobalState::TSClientInit, @@ -244,13 +253,6 @@ impl RFBState { return AppLayerResult::ok(); } } - - if let Some(current_transaction) = self.get_current_tx() { - current_transaction.ts_security_type_selection = Some(request); - current_transaction.chosen_security_type = Some(chosen_security_type as u32); - } else { - debug_validate_fail!("no transaction set at security type stage"); - } } Err(nom::Err::Incomplete(_)) => { return AppLayerResult::incomplete(