From: Philippe Antoine Date: Thu, 1 Oct 2020 13:10:27 +0000 (+0200) Subject: http2: complete parsing of priority frames X-Git-Tag: suricata-6.0.0~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64fcba228bca7f417d4e79f31b226b16dc9272dc;p=thirdparty%2Fsuricata.git http2: complete parsing of priority frames --- diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index c7b55c3f60..9a03301039 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -56,7 +56,7 @@ const HTTP2_FRAME_HEADER_LEN: usize = 9; const HTTP2_MAGIC_LEN: usize = 24; const HTTP2_FRAME_GOAWAY_LEN: usize = 4; const HTTP2_FRAME_RSTSTREAM_LEN: usize = 4; -const HTTP2_FRAME_PRIORITY_LEN: usize = 1; +const HTTP2_FRAME_PRIORITY_LEN: usize = 5; const HTTP2_FRAME_WINDOWUPDATE_LEN: usize = 4; //TODO make this configurable pub const HTTP2_MAX_TABLESIZE: u32 = 0x10000; // 65536 diff --git a/rust/src/http2/parser.rs b/rust/src/http2/parser.rs index d0e3b3aaa9..9ba2e5835d 100644 --- a/rust/src/http2/parser.rs +++ b/rust/src/http2/parser.rs @@ -168,13 +168,17 @@ named!(pub http2_parse_frame_rststream, #[derive(Clone, Copy)] pub struct HTTP2FramePriority { + pub exclusive: u8, + pub dependency: u32, pub weight: u8, } named!(pub http2_parse_frame_priority, do_parse!( + sid: bits!( tuple!( take_bits!(1u8), + take_bits!(31u32) ) ) >> weight: be_u8 >> - (HTTP2FramePriority{weight}) + (HTTP2FramePriority{exclusive:sid.0, dependency:sid.1, weight}) ) );