From 5cca346f1684d7fe85ae5d42273d24588bebbf4a Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Mon, 27 Apr 2026 17:26:18 +0200 Subject: [PATCH] rust: format quic files Ticket: 3836 --- .github/workflows/builds.yml | 2 +- rust/src/quic/frames.rs | 11 ++++++++--- rust/src/quic/quic.rs | 7 ++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index f9eb0e7655..75fb39f676 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -390,7 +390,7 @@ jobs: working-directory: rust/derive - run: rustfmt --check rust/src/dns/*.rs rust/src/applayertemplate/*.rs rust/src/asn1/*.rs rust/src/bittorrent_dht/*.rs rust/src/enip/*.rs rust/src/ffi/*.rs rust/src/ftp/*.rs - rust/src/ldap/*.rs rust/src/mime/*.rs rust/src/ntp/*.rs + rust/src/ldap/*.rs rust/src/mime/*.rs rust/src/ntp/*.rs rust/src/quic/*.rs - name: Check if Cargo.lock.in is up to date run: | cp rust/Cargo.lock rust/Cargo.lock.in diff --git a/rust/src/quic/frames.rs b/rust/src/quic/frames.rs index e99e2154e5..136c1a0c9f 100644 --- a/rust/src/quic/frames.rs +++ b/rust/src/quic/frames.rs @@ -323,7 +323,10 @@ fn parse_quic_handshake(msg: TlsMessage) -> Option { let mut ja3 = String::with_capacity(256); ja3.push_str(&u16::from(ch.version).to_string()); ja3.push(','); - let mut hs = HandshakeParams { quic: true, ..Default::default() }; + let mut hs = HandshakeParams { + quic: true, + ..Default::default() + }; let mut dash = false; for c in &ch.ciphers { if dash { @@ -434,7 +437,8 @@ fn parse_crypto_stream(input: &[u8]) -> IResult<&[u8], Vec, QuicError> let (rest, num_entries) = le_u16(rest)?; let (rest, _padding) = take(2usize)(rest)?; - let (rest, tags_offset) = count(complete(parse_tag_and_offset), num_entries.into()).parse(rest)?; + let (rest, tags_offset) = + count(complete(parse_tag_and_offset), num_entries.into()).parse(rest)?; // Convert (Tag, Offset) to (Tag, Value) let mut tags = Vec::new(); @@ -552,7 +556,8 @@ impl Frame { pub(crate) fn decode_frames<'a>( input: &'a [u8], past_frag: &'a [u8], past_fraglen: u32, ) -> IResult<&'a [u8], Vec, QuicError> { - let (rest, mut frames) = all_consuming(many0(complete(Frame::decode_frame))).parse(input)?; + let (rest, mut frames) = + all_consuming(many0(complete(Frame::decode_frame))).parse(input)?; // we use the already seen past fragment data let mut crypto_max_size = past_frag.len() as u64; diff --git a/rust/src/quic/quic.rs b/rust/src/quic/quic.rs index c5e96cda36..616e337b1e 100644 --- a/rust/src/quic/quic.rs +++ b/rust/src/quic/quic.rs @@ -309,8 +309,7 @@ impl QuicState { if self.hello_tc && self.hello_ts { let flags = match unsafe { ENCRYPTION_BYPASS_ENABLED } { EncryptionHandling::ENCRYPTION_HANDLING_BYPASS => { - APP_LAYER_PARSER_NO_INSPECTION - | APP_LAYER_PARSER_BYPASS_READY + APP_LAYER_PARSER_NO_INSPECTION | APP_LAYER_PARSER_BYPASS_READY } EncryptionHandling::ENCRYPTION_HANDLING_TRACK_ONLY => { APP_LAYER_PARSER_NO_INSPECTION @@ -576,9 +575,7 @@ pub unsafe extern "C" fn SCRegisterQuicParser() { localstorage_new: None, localstorage_free: None, get_tx_files: None, - get_tx_iterator: Some( - applayer::state_get_tx_iterator::, - ), + get_tx_iterator: Some(applayer::state_get_tx_iterator::), get_tx_data: quic_get_tx_data, get_state_data: quic_get_state_data, apply_tx_config: None,