From: Philippe Antoine Date: Tue, 6 Oct 2020 07:46:14 +0000 (+0200) Subject: http2: asymetric sizes for headers tables X-Git-Tag: suricata-6.0.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fd6f5bc61830eb3f3e305490be799aaf7beb4e8;p=thirdparty%2Fsuricata.git http2: asymetric sizes for headers tables The headers table from client to server and the one from server to client may have different maximum sizes (even if both endpoints have to keep both tables) --- diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index 9a03301039..8b4112ead6 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -466,17 +466,19 @@ impl HTTP2State { Ok((_, set)) => { for i in 0..set.len() { if set[i].id == parser::HTTP2SettingsId::SETTINGSHEADERTABLESIZE { - //set for both endpoints ? to be tested - self.dynamic_headers_tc.max_size = set[i].value as usize; - self.dynamic_headers_ts.max_size = set[i].value as usize; + //reverse order as this is what we accept from the other endpoint + let dyn_headers = if dir == STREAM_TOCLIENT { + &mut self.dynamic_headers_ts + } else { + &mut self.dynamic_headers_tc + }; + dyn_headers.max_size = set[i].value as usize; if set[i].value > HTTP2_MAX_TABLESIZE { //mark potential overflow - self.dynamic_headers_tc.overflow = 1; - self.dynamic_headers_ts.overflow = 1; + dyn_headers.overflow = 1; } else { //reset in case peer set a lower value, to be tested - self.dynamic_headers_tc.overflow = 0; - self.dynamic_headers_ts.overflow = 0; + dyn_headers.overflow = 0; } } }