"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/service_inspectors/http2_inspect/http2_data_cutter.cc" between
snort3-3.1.36.0.tar.gz and snort3-3.1.38.0.tar.gz

About: Snort 3 is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

http2_data_cutter.cc  (snort3-3.1.36.0):http2_data_cutter.cc  (snort3-3.1.38.0)
skipping to change at line 29 skipping to change at line 29
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include "http2_data_cutter.h" #include "http2_data_cutter.h"
#include "service_inspectors/http_inspect/http_flow_data.h" #include "service_inspectors/http_inspect/http_flow_data.h"
#include "service_inspectors/http_inspect/http_stream_splitter.h" #include "service_inspectors/http_inspect/http_stream_splitter.h"
#include "http2_dummy_packet.h"
#include "http2_utils.h" #include "http2_utils.h"
using namespace snort; using namespace snort;
using namespace HttpCommon; using namespace HttpCommon;
using namespace Http2Enums; using namespace Http2Enums;
Http2DataCutter::Http2DataCutter(Http2FlowData* _session_data, HttpCommon::Sourc eId src_id) : Http2DataCutter::Http2DataCutter(Http2FlowData* _session_data, HttpCommon::Sourc eId src_id) :
session_data(_session_data), source_id(src_id) session_data(_session_data), source_id(src_id)
{ } { }
skipping to change at line 134 skipping to change at line 133
frame_bytes_seen += cur_pos - data_offset; frame_bytes_seen += cur_pos - data_offset;
data_offset = cur_pos; data_offset = cur_pos;
*flush_offset = cur_pos; *flush_offset = cur_pos;
StreamSplitter::Status scan_result = StreamSplitter::SEARCH; StreamSplitter::Status scan_result = StreamSplitter::SEARCH;
if (cur_data > 0) if (cur_data > 0)
{ {
uint32_t http_flush_offset = 0; uint32_t http_flush_offset = 0;
Http2DummyPacket dummy_pkt;
dummy_pkt.flow = session_data->flow;
uint32_t unused = 0;
session_data->stream_in_hi = session_data->current_stream[source_id]; session_data->stream_in_hi = session_data->current_stream[source_id];
if ((data_bytes_read == data_len) && (frame_flags & FLAG_END_STREAM)) if ((data_bytes_read == data_len) && (frame_flags & FLAG_END_STREAM))
{ {
HttpFlowData* const hi_flow = stream->get_hi_flow_data(); HttpFlowData* const hi_flow = stream->get_hi_flow_data();
hi_flow->set_h2_body_state(source_id, H2_BODY_LAST_SEG); hi_flow->set_h2_body_state(source_id, H2_BODY_LAST_SEG);
} }
scan_result = session_data->hi_ss[source_id]->scan(&dummy_pkt, data + cu scan_result = session_data->hi_ss[source_id]->scan(session_data->flow, d
r_data_offset, ata + cur_data_offset, cur_data,
cur_data, unused, &http_flush_offset); &http_flush_offset);
session_data->stream_in_hi = NO_STREAM_ID; session_data->stream_in_hi = NO_STREAM_ID;
switch (scan_result) switch (scan_result)
{ {
case StreamSplitter::FLUSH: case StreamSplitter::FLUSH:
{ {
bytes_sent_http += http_flush_offset; bytes_sent_http += http_flush_offset;
const uint32_t unused_input = cur_data - http_flush_offset; const uint32_t unused_input = cur_data - http_flush_offset;
data_bytes_read -= unused_input; data_bytes_read -= unused_input;
data_offset -= unused_input; data_offset -= unused_input;
*flush_offset -= unused_input; *flush_offset -= unused_input;
 End of changes. 3 change blocks. 
7 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)