rust: format quic files

Ticket: 3836
pull/15451/head
Philippe Antoine 3 months ago committed by Victor Julien
parent 415360d9e8
commit 5cca346f16

@ -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

@ -323,7 +323,10 @@ fn parse_quic_handshake(msg: TlsMessage) -> Option<Frame> {
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<TagValue>, 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<Frame>, 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;

@ -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::<QuicState, QuicTransaction>,
),
get_tx_iterator: Some(applayer::state_get_tx_iterator::<QuicState, QuicTransaction>),
get_tx_data: quic_get_tx_data,
get_state_data: quic_get_state_data,
apply_tx_config: None,

Loading…
Cancel
Save