From: Mike Stepanek (mstepane) Date: Mon, 20 Jul 2020 12:14:42 +0000 (+0000) Subject: Merge pull request #2335 in SNORT/snort3 from ~THOPETER/snort3:nhttp141 to master X-Git-Tag: 3.0.2-3~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8074048c0a12ce5aa5d3ba49e795b09a73051362;p=thirdparty%2Fsnort3.git Merge pull request #2335 in SNORT/snort3 from ~THOPETER/snort3:nhttp141 to master Squashed commit of the following: commit c5c50405c5bab73b15c5fe10c20185cf7d34e71c Author: Tom Peters Date: Tue Jul 14 17:14:59 2020 -0400 http2_inpsect: fix interaction with tool tcpclose --- diff --git a/src/service_inspectors/http2_inspect/http2_stream_splitter.cc b/src/service_inspectors/http2_inspect/http2_stream_splitter.cc index 8674fea24..1ad19ef98 100644 --- a/src/service_inspectors/http2_inspect/http2_stream_splitter.cc +++ b/src/service_inspectors/http2_inspect/http2_stream_splitter.cc @@ -190,17 +190,17 @@ bool Http2StreamSplitter::finish(Flow* flow) Profile profile(Http2Module::get_profile_stats()); Http2FlowData* session_data = (Http2FlowData*)flow->get_flow_data(Http2FlowData::inspector_id); - // FIXIT-M - this assert has been changed to check for null session data and return false if so - // due to lack of reliable feedback to stream that scan has been called...if that is - // addressed in stream reassembly rewrite this can be reverted to an assert - //assert(session_data != nullptr); if (!session_data) return false; #ifdef REG_TEST if (HttpTestManager::use_test_output(HttpTestManager::IN_HTTP2)) { - if (!HttpTestManager::use_test_input(HttpTestManager::IN_HTTP2)) + if (HttpTestManager::use_test_input(HttpTestManager::IN_HTTP2)) + { + HttpTestManager::get_test_input_source()->finish(); + } + else { printf("Finish from flow data %" PRIu64 " direction %d\n", session_data->seq_num, source_id); @@ -209,8 +209,11 @@ bool Http2StreamSplitter::finish(Flow* flow) } #endif - // FIXIT-E not supported yet - return false; + bool need_reassemble = false; + + // Loop through all streams and call NHI finish() + + return need_reassemble; } bool Http2StreamSplitter::init_partial_flush(Flow* flow) diff --git a/src/service_inspectors/http_inspect/http_stream_splitter_finish.cc b/src/service_inspectors/http_inspect/http_stream_splitter_finish.cc index 695fdd35e..a5ca4eae9 100644 --- a/src/service_inspectors/http_inspect/http_stream_splitter_finish.cc +++ b/src/service_inspectors/http_inspect/http_stream_splitter_finish.cc @@ -41,10 +41,6 @@ bool HttpStreamSplitter::finish(Flow* flow) Profile profile(HttpModule::get_profile_stats()); HttpFlowData* session_data = HttpInspect::http_get_flow_data(flow); - // FIXIT-M - this assert has been changed to check for null session data and return false if so - // due to lack of reliable feedback to stream that scan has been called...if that is - // addressed in stream reassembly rewrite this can be reverted to an assert - //assert(session_data != nullptr); if(!session_data) return false; @@ -109,6 +105,7 @@ bool HttpStreamSplitter::finish(Flow* flow) (session_data->cutter[source_id] == nullptr) && (session_data->section_type[source_id] == SEC__NOT_COMPUTE)) { + assert(!session_data->for_http2); // Set up to process empty header section uint32_t not_used; prepare_flush(session_data, ¬_used, SEC_HEADER, 0, 0, 0, false, 0, 0);