62 static bool DetectHttpRawHeaderValidateCallback(
64 static int g_http_raw_header_buffer_id = 0;
65 static int g_http2_thread_id = 0;
69 const uint8_t flow_flags,
void *txv,
const int list_id);
87 "content modifier to match the raw HTTP header buffer";
110 PrefilterMpmHttpHeaderRawRequestRegister, NULL,
ALPROTO_HTTP1,
113 PrefilterMpmHttpHeaderRawResponseRegister, NULL,
ALPROTO_HTTP1,
130 DetectHttpRawHeaderValidateCallback);
132 "http2.raw_header", SCHttp2ThreadBufDataInit, NULL, SCHttp2ThreadBufDataFree);
174 static bool DetectHttpRawHeaderValidateCallback(
178 *sigerror =
"http_raw_header signature "
179 "without a flow direction. Use flow:to_server for "
180 "inspecting request headers or flow:to_client for "
181 "inspecting response headers.";
191 const uint8_t flow_flags,
void *txv,
const int list_id)
195 htp_tx_t *tx = (htp_tx_t *)txv;
199 const bool ts = ((flow_flags & STREAM_TOSERVER) != 0);
200 const uint8_t *data =
ts ?
204 const uint32_t data_len =
ts ?
208 det_ctx, list_id, buffer, data, data_len, transforms);
221 const uint8_t *b = NULL;
224 if (thread_buf == NULL)
226 if (SCHttp2TxGetHeadersRaw(txv, flow_flags, &b, &b_len, thread_buf) != 1)
228 if (b == NULL || b_len == 0)
260 const int list_id =
ctx->list_id;
263 flags, txv, list_id);
268 const uint8_t *data = buffer->
inspect;
273 if (data != NULL && data_len >= mpm_ctx->
minlen) {
275 mpm_ctx, &det_ctx->
mtc, &det_ctx->
pmq, data, data_len);
292 PrefilterMpmHttpHeaderRaw(det_ctx, pectx, p, f, txv, idx, _txd,
flags);
296 static void PrefilterMpmHttpHeaderRawFree(
void *ptr)
315 HTP_REQUEST_PROGRESS_HEADERS + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->
pname);
322 pectx =
SCCalloc(1,
sizeof(*pectx));
330 HTP_REQUEST_PROGRESS_TRAILER + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->
pname);
351 HTP_RESPONSE_PROGRESS_HEADERS, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->
pname);
358 pectx =
SCCalloc(1,
sizeof(*pectx));
366 HTP_RESPONSE_PROGRESS_TRAILER, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->
pname);