mirror of https://github.com/OISF/suricata
Merge 82177e0eec into 9a37bb659b
commit
a627bec679
@ -0,0 +1,84 @@
|
||||
>>>
|
||||
POST / HTTP/1.1
|
||||
Host: x
|
||||
Transfer-Encoding: chunked
|
||||
|
||||
1
|
||||
x
|
||||
0
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
|
||||
|
||||
<<<
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 0
|
||||
|
||||
@ -0,0 +1,84 @@
|
||||
>>>
|
||||
GET / HTTP/1.1
|
||||
Host: x
|
||||
|
||||
|
||||
<<<
|
||||
HTTP/1.1 200 OK
|
||||
Transfer-Encoding: chunked
|
||||
|
||||
1
|
||||
x
|
||||
0
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
A: v
|
||||
|
||||
|
||||
@ -0,0 +1,217 @@
|
||||
/* Copyright (C) 2026 Open Information Security Foundation
|
||||
*
|
||||
* You can copy, redistribute or modify this Program under the terms of
|
||||
* the GNU General Public License version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* version 2 along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \author Victor Julien <victor@inliniac.net>
|
||||
*
|
||||
* Names of the trailer fields of an HTTP/1 chunked message.
|
||||
*/
|
||||
|
||||
#include "suricata-common.h"
|
||||
|
||||
#include "detect.h"
|
||||
#include "detect-parse.h"
|
||||
#include "detect-engine.h"
|
||||
#include "detect-engine-buffer.h"
|
||||
#include "detect-engine-mpm.h"
|
||||
#include "detect-engine-prefilter.h"
|
||||
#include "detect-engine-state.h"
|
||||
#include "detect-content.h"
|
||||
#include "detect-http-trailer.h"
|
||||
#include "detect-http-header-common.h"
|
||||
|
||||
#include "app-layer.h"
|
||||
#include "app-layer-parser.h"
|
||||
#include "app-layer-htp.h"
|
||||
|
||||
#include "flow.h"
|
||||
#include "util-debug.h"
|
||||
#include "util-print.h"
|
||||
|
||||
#define KEYWORD_NAME "http.trailer_names"
|
||||
#define KEYWORD_NAME_LEGACY "http_trailer_names"
|
||||
#define KEYWORD_DOC "http-keywords.html#http-trailer-names"
|
||||
#define BUFFER_NAME "http_trailer_names"
|
||||
#define BUFFER_DESC "http trailer field names"
|
||||
static int g_buffer_id = 0;
|
||||
static int g_keyword_thread_id = 0;
|
||||
static int g_http2_thread_id = 0;
|
||||
|
||||
#define BUFFER_SIZE_STEP 256
|
||||
static HttpHeaderThreadDataConfig g_td_config = { BUFFER_SIZE_STEP };
|
||||
|
||||
static InspectionBuffer *GetBuffer1ForTX(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id);
|
||||
static InspectionBuffer *GetBuffer2ForTX(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id);
|
||||
|
||||
static int DetectHttpTrailerNamesSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
|
||||
{
|
||||
if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0)
|
||||
return -1;
|
||||
if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DetectHttpTrailerNamesRegister(void)
|
||||
{
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_NAMES].name = KEYWORD_NAME;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_NAMES].alias = KEYWORD_NAME_LEGACY;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_NAMES].desc = BUFFER_NAME " sticky buffer";
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_NAMES].url = "/rules/" KEYWORD_DOC;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_NAMES].Setup = DetectHttpTrailerNamesSetup;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_NAMES].flags |= SIGMATCH_NOOPT | SIGMATCH_INFO_STICKY_BUFFER;
|
||||
|
||||
DetectAppLayerInspectEngineRegister(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOSERVER,
|
||||
HTP_REQUEST_PROGRESS_TRAILER, DetectEngineInspectBufferGeneric, GetBuffer1ForTX);
|
||||
DetectAppLayerInspectEngineRegister(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOCLIENT,
|
||||
HTP_RESPONSE_PROGRESS_TRAILER, DetectEngineInspectBufferGeneric, GetBuffer1ForTX);
|
||||
|
||||
DetectAppLayerMpmRegister(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister,
|
||||
GetBuffer1ForTX, ALPROTO_HTTP1, HTP_REQUEST_PROGRESS_TRAILER);
|
||||
DetectAppLayerMpmRegister(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, PrefilterGenericMpmRegister,
|
||||
GetBuffer1ForTX, ALPROTO_HTTP1, HTP_RESPONSE_PROGRESS_TRAILER);
|
||||
|
||||
/* http2: a trailing HEADERS block completes at the trailer state */
|
||||
DetectAppLayerInspectEngineRegisterSubState(BUFFER_NAME, ALPROTO_HTTP2, SIG_FLAG_TOSERVER,
|
||||
HTTP2TxTypeStream, HTTP2ProgTrailers, DetectEngineInspectBufferGeneric,
|
||||
GetBuffer2ForTX);
|
||||
DetectAppLayerInspectEngineRegisterSubState(BUFFER_NAME, ALPROTO_HTTP2, SIG_FLAG_TOCLIENT,
|
||||
HTTP2TxTypeStream, HTTP2ProgTrailers, DetectEngineInspectBufferGeneric,
|
||||
GetBuffer2ForTX);
|
||||
DetectAppLayerMpmRegisterSubState(BUFFER_NAME, SIG_FLAG_TOSERVER, 2,
|
||||
PrefilterGenericMpmRegister, GetBuffer2ForTX, ALPROTO_HTTP2, HTTP2TxTypeStream,
|
||||
HTTP2ProgTrailers);
|
||||
DetectAppLayerMpmRegisterSubState(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2,
|
||||
PrefilterGenericMpmRegister, GetBuffer2ForTX, ALPROTO_HTTP2, HTTP2TxTypeStream,
|
||||
HTTP2ProgTrailers);
|
||||
|
||||
DetectBufferTypeSetDescriptionByName(BUFFER_NAME, BUFFER_DESC);
|
||||
|
||||
g_buffer_id = DetectBufferTypeGetByName(BUFFER_NAME);
|
||||
|
||||
g_keyword_thread_id = SCDetectRegisterThreadCtxGlobalFuncs(
|
||||
KEYWORD_NAME, HttpHeaderThreadDataInit, &g_td_config, HttpHeaderThreadDataFree);
|
||||
|
||||
g_http2_thread_id = SCDetectRegisterThreadCtxGlobalFuncs(
|
||||
"http2.trailer_names", SCDetectThreadBufDataInit, NULL, SCDetectThreadBufDataFree);
|
||||
}
|
||||
|
||||
static uint8_t *GetBufferForTX(
|
||||
htp_tx_t *tx, DetectEngineThreadCtx *det_ctx, uint8_t flags, uint32_t *buffer_len)
|
||||
{
|
||||
*buffer_len = 0;
|
||||
|
||||
if (!HtpTrailerBlockIsComplete(tx, flags))
|
||||
return NULL;
|
||||
|
||||
HttpHeaderThreadData *hdr_td = NULL;
|
||||
HttpHeaderBuffer *buf = HttpHeaderGetBufferSpace(det_ctx, flags, g_keyword_thread_id, &hdr_td);
|
||||
if (unlikely(buf == NULL)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const htp_headers_t *trailers =
|
||||
(flags & STREAM_TOSERVER) ? htp_tx_request_trailers(tx) : htp_tx_response_trailers(tx);
|
||||
if (trailers == NULL)
|
||||
return NULL;
|
||||
|
||||
/* fill the buffer. \r\nName1\r\nName2\r\n\r\n */
|
||||
size_t i = 0;
|
||||
size_t no_of_trailers = htp_headers_size(trailers);
|
||||
for (; i < no_of_trailers; i++) {
|
||||
const htp_header_t *h = htp_headers_get_index(trailers, i);
|
||||
size_t size = htp_header_name_len(h) + 2; // for \r\n
|
||||
if (i == 0)
|
||||
size += 2;
|
||||
if (i + 1 == no_of_trailers)
|
||||
size += 2;
|
||||
|
||||
if (size + buf->len > buf->size) {
|
||||
if (HttpHeaderExpandBuffer(hdr_td, buf, size) != 0) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* start with a \r\n */
|
||||
if (i == 0) {
|
||||
buf->buffer[buf->len++] = '\r';
|
||||
buf->buffer[buf->len++] = '\n';
|
||||
}
|
||||
|
||||
memcpy(buf->buffer + buf->len, htp_header_name_ptr(h), htp_header_name_len(h));
|
||||
buf->len += htp_header_name_len(h);
|
||||
buf->buffer[buf->len++] = '\r';
|
||||
buf->buffer[buf->len++] = '\n';
|
||||
|
||||
/* end with an extra \r\n */
|
||||
if (i + 1 == no_of_trailers) {
|
||||
buf->buffer[buf->len++] = '\r';
|
||||
buf->buffer[buf->len++] = '\n';
|
||||
}
|
||||
}
|
||||
|
||||
*buffer_len = buf->len;
|
||||
return buf->buffer;
|
||||
}
|
||||
|
||||
static InspectionBuffer *GetBuffer1ForTX(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id)
|
||||
{
|
||||
InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
|
||||
if (buffer->inspect == NULL) {
|
||||
uint32_t rawdata_len = 0;
|
||||
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, flow_flags, &rawdata_len);
|
||||
if (rawdata_len == 0)
|
||||
return NULL;
|
||||
|
||||
SCInspectionBufferSetupAndApplyTransforms(
|
||||
det_ctx, list_id, buffer, rawdata, rawdata_len, transforms);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static InspectionBuffer *GetBuffer2ForTX(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id)
|
||||
{
|
||||
InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
|
||||
if (buffer->inspect == NULL) {
|
||||
uint32_t b_len = 0;
|
||||
const uint8_t *b = NULL;
|
||||
|
||||
void *thread_buf = SCDetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, g_http2_thread_id);
|
||||
if (thread_buf == NULL)
|
||||
return NULL;
|
||||
|
||||
if (SCHttp2TxGetTrailerNames(txv, flow_flags, &b, &b_len, thread_buf) != 1)
|
||||
return NULL;
|
||||
if (b == NULL || b_len == 0)
|
||||
return NULL;
|
||||
|
||||
SCInspectionBufferSetupAndApplyTransforms(det_ctx, list_id, buffer, b, b_len, transforms);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
@ -0,0 +1,163 @@
|
||||
/* Copyright (C) 2026 Open Information Security Foundation
|
||||
*
|
||||
* You can copy, redistribute or modify this Program under the terms of
|
||||
* the GNU General Public License version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* version 2 along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \author Victor Julien <victor@inliniac.net>
|
||||
*
|
||||
* Raw bytes of the trailer section of an HTTP/1 chunked message.
|
||||
*/
|
||||
|
||||
#include "suricata-common.h"
|
||||
|
||||
#include "detect.h"
|
||||
#include "detect-parse.h"
|
||||
#include "detect-engine.h"
|
||||
#include "detect-engine-buffer.h"
|
||||
#include "detect-engine-mpm.h"
|
||||
#include "detect-engine-prefilter.h"
|
||||
#include "detect-engine-state.h"
|
||||
#include "detect-content.h"
|
||||
#include "detect-http-trailer.h"
|
||||
|
||||
#include "app-layer.h"
|
||||
#include "app-layer-parser.h"
|
||||
#include "app-layer-htp.h"
|
||||
|
||||
#include "flow.h"
|
||||
#include "util-debug.h"
|
||||
#include "util-print.h"
|
||||
|
||||
#define KEYWORD_NAME "http.trailer.raw"
|
||||
#define KEYWORD_NAME_LEGACY "http_trailer_raw"
|
||||
#define KEYWORD_DOC "http-keywords.html#http-trailer-raw"
|
||||
#define BUFFER_NAME "http_trailer_raw"
|
||||
#define BUFFER_DESC "raw http trailer data"
|
||||
static int g_buffer_id = 0;
|
||||
static int g_http2_thread_id = 0;
|
||||
|
||||
static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id);
|
||||
static InspectionBuffer *GetData2(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id);
|
||||
|
||||
static int DetectHttpTrailerRawSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
|
||||
{
|
||||
if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0)
|
||||
return -1;
|
||||
if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DetectHttpTrailerRawRegister(void)
|
||||
{
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_RAW].name = KEYWORD_NAME;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_RAW].alias = KEYWORD_NAME_LEGACY;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_RAW].desc = BUFFER_NAME " sticky buffer";
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_RAW].url = "/rules/" KEYWORD_DOC;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_RAW].Setup = DetectHttpTrailerRawSetup;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER_RAW].flags |= SIGMATCH_NOOPT | SIGMATCH_INFO_STICKY_BUFFER;
|
||||
|
||||
DetectAppLayerInspectEngineRegister(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOSERVER,
|
||||
HTP_REQUEST_PROGRESS_TRAILER, DetectEngineInspectBufferGeneric, GetData);
|
||||
DetectAppLayerInspectEngineRegister(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOCLIENT,
|
||||
HTP_RESPONSE_PROGRESS_TRAILER, DetectEngineInspectBufferGeneric, GetData);
|
||||
|
||||
DetectAppLayerMpmRegister(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister,
|
||||
GetData, ALPROTO_HTTP1, HTP_REQUEST_PROGRESS_TRAILER);
|
||||
DetectAppLayerMpmRegister(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, PrefilterGenericMpmRegister,
|
||||
GetData, ALPROTO_HTTP1, HTP_RESPONSE_PROGRESS_TRAILER);
|
||||
|
||||
/* http2: a trailing HEADERS block completes at the trailer state */
|
||||
DetectAppLayerInspectEngineRegisterSubState(BUFFER_NAME, ALPROTO_HTTP2, SIG_FLAG_TOSERVER,
|
||||
HTTP2TxTypeStream, HTTP2ProgTrailers, DetectEngineInspectBufferGeneric, GetData2);
|
||||
DetectAppLayerInspectEngineRegisterSubState(BUFFER_NAME, ALPROTO_HTTP2, SIG_FLAG_TOCLIENT,
|
||||
HTTP2TxTypeStream, HTTP2ProgTrailers, DetectEngineInspectBufferGeneric, GetData2);
|
||||
DetectAppLayerMpmRegisterSubState(BUFFER_NAME, SIG_FLAG_TOSERVER, 2,
|
||||
PrefilterGenericMpmRegister, GetData2, ALPROTO_HTTP2, HTTP2TxTypeStream,
|
||||
HTTP2ProgTrailers);
|
||||
DetectAppLayerMpmRegisterSubState(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2,
|
||||
PrefilterGenericMpmRegister, GetData2, ALPROTO_HTTP2, HTTP2TxTypeStream,
|
||||
HTTP2ProgTrailers);
|
||||
|
||||
DetectBufferTypeSetDescriptionByName(BUFFER_NAME, BUFFER_DESC);
|
||||
|
||||
g_buffer_id = DetectBufferTypeGetByName(BUFFER_NAME);
|
||||
|
||||
g_http2_thread_id = SCDetectRegisterThreadCtxGlobalFuncs(
|
||||
"http2.trailer_raw", SCDetectThreadBufDataInit, NULL, SCDetectThreadBufDataFree);
|
||||
}
|
||||
|
||||
static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id)
|
||||
{
|
||||
InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
|
||||
if (buffer->inspect == NULL) {
|
||||
htp_tx_t *tx = (htp_tx_t *)txv;
|
||||
|
||||
HtpTxUserData *tx_ud = htp_tx_get_user_data(tx);
|
||||
|
||||
const bool ts = ((flow_flags & STREAM_TOSERVER) != 0);
|
||||
if (!HtpTrailerBlockIsComplete(tx, flow_flags))
|
||||
return NULL;
|
||||
const uint8_t *data = ts ? tx_ud->request_trailers_raw : tx_ud->response_trailers_raw;
|
||||
if (data == NULL)
|
||||
return NULL;
|
||||
const uint32_t data_len =
|
||||
ts ? tx_ud->request_trailers_raw_len : tx_ud->response_trailers_raw_len;
|
||||
/* A section with no trailer fields holds only the framing that ends the chunked
|
||||
* body - the empty line, possibly with stray whitespace. Not buffer content. */
|
||||
const htp_headers_t *trailers =
|
||||
ts ? htp_tx_request_trailers(tx) : htp_tx_response_trailers(tx);
|
||||
if (trailers == NULL || htp_headers_size(trailers) == 0)
|
||||
return NULL;
|
||||
|
||||
SCInspectionBufferSetupAndApplyTransforms(
|
||||
det_ctx, list_id, buffer, data, data_len, transforms);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static InspectionBuffer *GetData2(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id)
|
||||
{
|
||||
InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
|
||||
if (buffer->inspect == NULL) {
|
||||
uint32_t b_len = 0;
|
||||
const uint8_t *b = NULL;
|
||||
|
||||
void *thread_buf = SCDetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, g_http2_thread_id);
|
||||
if (thread_buf == NULL)
|
||||
return NULL;
|
||||
|
||||
if (SCHttp2TxGetTrailersRaw(txv, flow_flags, &b, &b_len, thread_buf) != 1)
|
||||
return NULL;
|
||||
if (b == NULL || b_len == 0)
|
||||
return NULL;
|
||||
|
||||
SCInspectionBufferSetupAndApplyTransforms(det_ctx, list_id, buffer, b, b_len, transforms);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
@ -0,0 +1,219 @@
|
||||
/* Copyright (C) 2026 Open Information Security Foundation
|
||||
*
|
||||
* You can copy, redistribute or modify this Program under the terms of
|
||||
* the GNU General Public License version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* version 2 along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \author Victor Julien <victor@inliniac.net>
|
||||
*
|
||||
* Trailer fields of an HTTP/1 chunked message, as "Name: value\r\n" per field.
|
||||
* The header section is a separate buffer: see detect-http-header.c.
|
||||
*/
|
||||
|
||||
#include "suricata-common.h"
|
||||
|
||||
#include "detect.h"
|
||||
#include "detect-parse.h"
|
||||
#include "detect-engine.h"
|
||||
#include "detect-engine-buffer.h"
|
||||
#include "detect-engine-mpm.h"
|
||||
#include "detect-engine-prefilter.h"
|
||||
#include "detect-engine-state.h"
|
||||
#include "detect-content.h"
|
||||
#include "detect-http-trailer.h"
|
||||
#include "detect-http-header-common.h"
|
||||
|
||||
#include "app-layer.h"
|
||||
#include "app-layer-parser.h"
|
||||
#include "app-layer-htp.h"
|
||||
|
||||
#include "flow.h"
|
||||
#include "util-debug.h"
|
||||
#include "util-print.h"
|
||||
|
||||
#define KEYWORD_NAME "http.trailer"
|
||||
#define KEYWORD_NAME_LEGACY "http_trailer"
|
||||
#define KEYWORD_DOC "http-keywords.html#http-trailer"
|
||||
#define BUFFER_NAME "http_trailer"
|
||||
#define BUFFER_DESC "http trailer fields"
|
||||
static int g_buffer_id = 0;
|
||||
static int g_keyword_thread_id = 0;
|
||||
static int g_http2_thread_id = 0;
|
||||
|
||||
#ifdef UNITTESTS
|
||||
void DetectHttpTrailerRegisterTests(void);
|
||||
#endif
|
||||
|
||||
#define BUFFER_SIZE_STEP 512
|
||||
static HttpHeaderThreadDataConfig g_td_config = { BUFFER_SIZE_STEP };
|
||||
|
||||
static InspectionBuffer *GetBuffer1ForTX(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id);
|
||||
static InspectionBuffer *GetBuffer2ForTX(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id);
|
||||
|
||||
static int DetectHttpTrailerSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str)
|
||||
{
|
||||
if (SCDetectBufferSetActiveList(de_ctx, s, g_buffer_id) < 0)
|
||||
return -1;
|
||||
if (SCDetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DetectHttpTrailerRegister(void)
|
||||
{
|
||||
sigmatch_table[DETECT_HTTP_TRAILER].name = KEYWORD_NAME;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER].alias = KEYWORD_NAME_LEGACY;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER].desc = BUFFER_NAME " sticky buffer";
|
||||
sigmatch_table[DETECT_HTTP_TRAILER].url = "/rules/" KEYWORD_DOC;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER].Setup = DetectHttpTrailerSetup;
|
||||
sigmatch_table[DETECT_HTTP_TRAILER].flags |= SIGMATCH_NOOPT | SIGMATCH_INFO_STICKY_BUFFER;
|
||||
|
||||
#ifdef UNITTESTS
|
||||
sigmatch_table[DETECT_HTTP_TRAILER].RegisterTests = DetectHttpTrailerRegisterTests;
|
||||
#endif
|
||||
|
||||
/* Inspect at the trailer state, the state the trailer section completes in. Rounds
|
||||
* while the section is still arriving are not final, the one at COMPLETE is. */
|
||||
DetectAppLayerInspectEngineRegister(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOSERVER,
|
||||
HTP_REQUEST_PROGRESS_TRAILER, DetectEngineInspectBufferGeneric, GetBuffer1ForTX);
|
||||
DetectAppLayerInspectEngineRegister(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOCLIENT,
|
||||
HTP_RESPONSE_PROGRESS_TRAILER, DetectEngineInspectBufferGeneric, GetBuffer1ForTX);
|
||||
|
||||
DetectAppLayerMpmRegister(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister,
|
||||
GetBuffer1ForTX, ALPROTO_HTTP1, HTP_REQUEST_PROGRESS_TRAILER);
|
||||
DetectAppLayerMpmRegister(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, PrefilterGenericMpmRegister,
|
||||
GetBuffer1ForTX, ALPROTO_HTTP1, HTP_RESPONSE_PROGRESS_TRAILER);
|
||||
|
||||
/* http2: a trailing HEADERS block completes at the trailer state */
|
||||
DetectAppLayerInspectEngineRegisterSubState(BUFFER_NAME, ALPROTO_HTTP2, SIG_FLAG_TOSERVER,
|
||||
HTTP2TxTypeStream, HTTP2ProgTrailers, DetectEngineInspectBufferGeneric,
|
||||
GetBuffer2ForTX);
|
||||
DetectAppLayerInspectEngineRegisterSubState(BUFFER_NAME, ALPROTO_HTTP2, SIG_FLAG_TOCLIENT,
|
||||
HTTP2TxTypeStream, HTTP2ProgTrailers, DetectEngineInspectBufferGeneric,
|
||||
GetBuffer2ForTX);
|
||||
DetectAppLayerMpmRegisterSubState(BUFFER_NAME, SIG_FLAG_TOSERVER, 2,
|
||||
PrefilterGenericMpmRegister, GetBuffer2ForTX, ALPROTO_HTTP2, HTTP2TxTypeStream,
|
||||
HTTP2ProgTrailers);
|
||||
DetectAppLayerMpmRegisterSubState(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2,
|
||||
PrefilterGenericMpmRegister, GetBuffer2ForTX, ALPROTO_HTTP2, HTTP2TxTypeStream,
|
||||
HTTP2ProgTrailers);
|
||||
|
||||
DetectBufferTypeSetDescriptionByName(BUFFER_NAME, BUFFER_DESC);
|
||||
|
||||
g_buffer_id = DetectBufferTypeGetByName(BUFFER_NAME);
|
||||
|
||||
g_keyword_thread_id = SCDetectRegisterThreadCtxGlobalFuncs(
|
||||
KEYWORD_NAME, HttpHeaderThreadDataInit, &g_td_config, HttpHeaderThreadDataFree);
|
||||
|
||||
g_http2_thread_id = SCDetectRegisterThreadCtxGlobalFuncs(
|
||||
"http2.trailer", SCDetectThreadBufDataInit, NULL, SCDetectThreadBufDataFree);
|
||||
}
|
||||
|
||||
static uint8_t *GetBufferForTX(
|
||||
htp_tx_t *tx, DetectEngineThreadCtx *det_ctx, uint8_t flags, uint32_t *buffer_len)
|
||||
{
|
||||
*buffer_len = 0;
|
||||
|
||||
if (!HtpTrailerBlockIsComplete(tx, flags))
|
||||
return NULL;
|
||||
|
||||
HttpHeaderThreadData *hdr_td = NULL;
|
||||
HttpHeaderBuffer *buf = HttpHeaderGetBufferSpace(det_ctx, flags, g_keyword_thread_id, &hdr_td);
|
||||
if (unlikely(buf == NULL)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const htp_headers_t *trailers =
|
||||
(flags & STREAM_TOSERVER) ? htp_tx_request_trailers(tx) : htp_tx_response_trailers(tx);
|
||||
if (trailers == NULL)
|
||||
return NULL;
|
||||
|
||||
size_t i = 0;
|
||||
size_t no_of_trailers = htp_headers_size(trailers);
|
||||
for (; i < no_of_trailers; i++) {
|
||||
const htp_header_t *h = htp_headers_get_index(trailers, i);
|
||||
size_t size = htp_header_name_len(h) + htp_header_value_len(h) + 4;
|
||||
|
||||
if (size + buf->len > buf->size) {
|
||||
if (HttpHeaderExpandBuffer(hdr_td, buf, size) != 0) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(buf->buffer + buf->len, htp_header_name_ptr(h), htp_header_name_len(h));
|
||||
buf->len += htp_header_name_len(h);
|
||||
buf->buffer[buf->len++] = ':';
|
||||
buf->buffer[buf->len++] = ' ';
|
||||
memcpy(buf->buffer + buf->len, htp_header_value_ptr(h), htp_header_value_len(h));
|
||||
buf->len += htp_header_value_len(h);
|
||||
buf->buffer[buf->len++] = '\r';
|
||||
buf->buffer[buf->len++] = '\n';
|
||||
}
|
||||
|
||||
*buffer_len = buf->len;
|
||||
return buf->buffer;
|
||||
}
|
||||
|
||||
static InspectionBuffer *GetBuffer1ForTX(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id)
|
||||
{
|
||||
InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
|
||||
if (buffer->inspect == NULL) {
|
||||
uint32_t rawdata_len = 0;
|
||||
uint8_t *rawdata = GetBufferForTX(txv, det_ctx, flow_flags, &rawdata_len);
|
||||
if (rawdata_len == 0)
|
||||
return NULL;
|
||||
|
||||
SCInspectionBufferSetupAndApplyTransforms(
|
||||
det_ctx, list_id, buffer, rawdata, rawdata_len, transforms);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static InspectionBuffer *GetBuffer2ForTX(DetectEngineThreadCtx *det_ctx,
|
||||
const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
|
||||
const int list_id)
|
||||
{
|
||||
InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
|
||||
if (buffer->inspect == NULL) {
|
||||
uint32_t b_len = 0;
|
||||
const uint8_t *b = NULL;
|
||||
|
||||
void *thread_buf = SCDetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, g_http2_thread_id);
|
||||
if (thread_buf == NULL)
|
||||
return NULL;
|
||||
|
||||
if (SCHttp2TxGetTrailers(txv, flow_flags, &b, &b_len, thread_buf) != 1)
|
||||
return NULL;
|
||||
if (b == NULL || b_len == 0)
|
||||
return NULL;
|
||||
|
||||
SCInspectionBufferSetupAndApplyTransforms(det_ctx, list_id, buffer, b, b_len, transforms);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
#ifdef UNITTESTS
|
||||
#include "tests/detect-http-trailer.c"
|
||||
#endif
|
||||
@ -0,0 +1,31 @@
|
||||
/* Copyright (C) 2026 Open Information Security Foundation
|
||||
*
|
||||
* You can copy, redistribute or modify this Program under the terms of
|
||||
* the GNU General Public License version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* version 2 along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \author Victor Julien <victor@inliniac.net>
|
||||
*/
|
||||
|
||||
#ifndef SURICATA_DETECT_HTTP_TRAILER_H
|
||||
#define SURICATA_DETECT_HTTP_TRAILER_H
|
||||
|
||||
void DetectHttpTrailerRegister(void);
|
||||
void DetectHttpTrailerNamesRegister(void);
|
||||
void DetectHttpTrailerRawRegister(void);
|
||||
|
||||
#endif /* SURICATA_DETECT_HTTP_TRAILER_H */
|
||||
@ -0,0 +1,195 @@
|
||||
/* Copyright (C) 2025 Open Information Security Foundation
|
||||
*
|
||||
* You can copy, redistribute or modify this Program under the terms of
|
||||
* the GNU General Public License version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* Tests for the http.trailer buffers. The peer asserts, that header buffers do not see
|
||||
* this data, are in tests/detect-http-header.c and tests/detect-http-raw-header.c.
|
||||
*/
|
||||
|
||||
#include "../suricata-common.h"
|
||||
#include "../flow.h"
|
||||
#include "../flow-util.h"
|
||||
#include "../app-layer.h"
|
||||
#include "../app-layer-parser.h"
|
||||
#include "../app-layer-htp.h"
|
||||
#include "../detect.h"
|
||||
#include "../detect-parse.h"
|
||||
#include "../detect-engine.h"
|
||||
#include "../detect-engine-alert.h"
|
||||
#include "../detect-engine-build.h"
|
||||
#include "../stream-tcp.h"
|
||||
#include "../counters.h"
|
||||
#include "../util-unittest.h"
|
||||
#include "../util-unittest-helper.h"
|
||||
|
||||
/* chunked request, two trailer fields */
|
||||
static uint8_t trailer_test_buf[] = "GET /index.html HTTP/1.0\r\n"
|
||||
"host: boom\r\n"
|
||||
"Transfer-Encoding: chunked\r\n"
|
||||
"\r\n"
|
||||
"13\r\n"
|
||||
"This is dummy body1\r\n"
|
||||
"0\r\n"
|
||||
"Dummy-Header: kaboom\r\n"
|
||||
"Header2: value2\r\n"
|
||||
"\r\n";
|
||||
|
||||
/* same message with an empty trailer section */
|
||||
static uint8_t trailer_test_buf_nofields[] = "GET /index.html HTTP/1.0\r\n"
|
||||
"host: boom\r\n"
|
||||
"Transfer-Encoding: chunked\r\n"
|
||||
"\r\n"
|
||||
"13\r\n"
|
||||
"This is dummy body1\r\n"
|
||||
"0\r\n"
|
||||
"\r\n";
|
||||
|
||||
/**
|
||||
* \brief Run one rule over a to-server stream and check whether it alerted.
|
||||
*
|
||||
* The whole transaction is handed to the parser in one go, so trailer state is
|
||||
* reached during the parse and detection runs on the following packet.
|
||||
*/
|
||||
static int DetectHttpTrailerRun(const char *sig, uint8_t *buf, uint32_t buf_len, bool expect)
|
||||
{
|
||||
TcpSession ssn;
|
||||
Packet *p = NULL;
|
||||
ThreadVars th_v;
|
||||
DetectEngineCtx *de_ctx = NULL;
|
||||
DetectEngineThreadCtx *det_ctx = NULL;
|
||||
Flow f;
|
||||
int result = 0;
|
||||
AppLayerParserThreadCtx *alp_tctx = AppLayerParserThreadCtxAlloc();
|
||||
|
||||
memset(&th_v, 0, sizeof(th_v));
|
||||
StatsThreadInit(&th_v.stats);
|
||||
memset(&f, 0, sizeof(f));
|
||||
memset(&ssn, 0, sizeof(ssn));
|
||||
|
||||
p = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
|
||||
if (p == NULL)
|
||||
goto end;
|
||||
if (alp_tctx == NULL)
|
||||
goto end;
|
||||
|
||||
FLOW_INITIALIZE(&f);
|
||||
f.protoctx = (void *)&ssn;
|
||||
f.proto = IPPROTO_TCP;
|
||||
f.flags |= FLOW_IPV4;
|
||||
p->flow = &f;
|
||||
p->flowflags |= FLOW_PKT_TOSERVER;
|
||||
p->flowflags |= FLOW_PKT_ESTABLISHED;
|
||||
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
|
||||
f.alproto = ALPROTO_HTTP1;
|
||||
|
||||
StreamTcpInitConfig(true);
|
||||
|
||||
de_ctx = DetectEngineCtxInit();
|
||||
FAIL_IF_NULL(de_ctx);
|
||||
de_ctx->flags |= DE_QUIET;
|
||||
de_ctx->sig_list = SigInit(de_ctx, sig);
|
||||
if (de_ctx->sig_list == NULL)
|
||||
goto end;
|
||||
|
||||
SigGroupBuild(de_ctx);
|
||||
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
|
||||
|
||||
FAIL_IF(AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, buf, buf_len) !=
|
||||
0);
|
||||
FAIL_IF_NULL(f.alstate);
|
||||
|
||||
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
|
||||
if (expect)
|
||||
FAIL_IF(!PacketAlertCheck(p, 1));
|
||||
else
|
||||
FAIL_IF(PacketAlertCheck(p, 1));
|
||||
|
||||
result = 1;
|
||||
end:
|
||||
if (alp_tctx != NULL)
|
||||
AppLayerParserThreadCtxFree(alp_tctx);
|
||||
if (det_ctx != NULL)
|
||||
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
|
||||
if (de_ctx != NULL)
|
||||
DetectEngineCtxFree(de_ctx);
|
||||
StreamTcpFreeConfig(true);
|
||||
FLOW_DESTROY(&f);
|
||||
UTHFreePackets(&p, 1);
|
||||
StatsThreadCleanup(&th_v.stats);
|
||||
return result;
|
||||
}
|
||||
|
||||
/** \test a trailer field matches on http.trailer */
|
||||
static int DetectHttpTrailerTest01(void)
|
||||
{
|
||||
return DetectHttpTrailerRun("alert http any any -> any any (flow:to_server; http.trailer; "
|
||||
"content:\"Dummy-Header\"; sid:1;)",
|
||||
trailer_test_buf, sizeof(trailer_test_buf) - 1, true);
|
||||
}
|
||||
|
||||
/** \test the raw buffer holds the field block as sent: name, value, order */
|
||||
static int DetectHttpTrailerTest02(void)
|
||||
{
|
||||
return DetectHttpTrailerRun("alert http any any -> any any (flow:to_server; http.trailer.raw; "
|
||||
"content:\"Dummy-Header: kaboom|0d 0a|Header2\"; sid:1;)",
|
||||
trailer_test_buf, sizeof(trailer_test_buf) - 1, true);
|
||||
}
|
||||
|
||||
/** \test http.trailer_names carries the field names */
|
||||
static int DetectHttpTrailerTest03(void)
|
||||
{
|
||||
return DetectHttpTrailerRun(
|
||||
"alert http any any -> any any (flow:to_server; http.trailer_names; "
|
||||
"content:\"Header2\"; sid:1;)",
|
||||
trailer_test_buf, sizeof(trailer_test_buf) - 1, true);
|
||||
}
|
||||
|
||||
/** \test ... and not the values */
|
||||
static int DetectHttpTrailerTest04(void)
|
||||
{
|
||||
return DetectHttpTrailerRun(
|
||||
"alert http any any -> any any (flow:to_server; http.trailer_names; "
|
||||
"content:\"kaboom\"; sid:1;)",
|
||||
trailer_test_buf, sizeof(trailer_test_buf) - 1, false);
|
||||
}
|
||||
|
||||
/** \test one rule can use a header buffer and a trailer buffer */
|
||||
static int DetectHttpTrailerTest05(void)
|
||||
{
|
||||
return DetectHttpTrailerRun("alert http any any -> any any (flow:to_server; http.header; "
|
||||
"content:\"host: boom\"; http.trailer; content:\"Header2\"; "
|
||||
"sid:1;)",
|
||||
trailer_test_buf, sizeof(trailer_test_buf) - 1, true);
|
||||
}
|
||||
|
||||
/** \test a trailer section without fields has nothing to match */
|
||||
static int DetectHttpTrailerTest06(void)
|
||||
{
|
||||
return DetectHttpTrailerRun("alert http any any -> any any (flow:to_server; http.trailer; "
|
||||
"content:\"Dummy-Header\"; sid:1;)",
|
||||
trailer_test_buf_nofields, sizeof(trailer_test_buf_nofields) - 1, false);
|
||||
}
|
||||
|
||||
void DetectHttpTrailerRegisterTests(void)
|
||||
{
|
||||
UtRegisterTest("DetectHttpTrailerTest01", DetectHttpTrailerTest01);
|
||||
UtRegisterTest("DetectHttpTrailerTest02", DetectHttpTrailerTest02);
|
||||
UtRegisterTest("DetectHttpTrailerTest03", DetectHttpTrailerTest03);
|
||||
UtRegisterTest("DetectHttpTrailerTest04", DetectHttpTrailerTest04);
|
||||
UtRegisterTest("DetectHttpTrailerTest05", DetectHttpTrailerTest05);
|
||||
UtRegisterTest("DetectHttpTrailerTest06", DetectHttpTrailerTest06);
|
||||
}
|
||||
Loading…
Reference in New Issue