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";
89 "/rules/http-keywords.html#http-header-and-http-raw-header";
111 PrefilterMpmHttpHeaderRawRequestRegister, NULL,
ALPROTO_HTTP1,
114 PrefilterMpmHttpHeaderRawResponseRegister, NULL,
ALPROTO_HTTP1,
131 DetectHttpRawHeaderValidateCallback);
133 "http2.raw_header", SCHttp2ThreadBufDataInit, NULL, SCHttp2ThreadBufDataFree);
175 static bool DetectHttpRawHeaderValidateCallback(
179 *sigerror =
"http_raw_header signature "
180 "without a flow direction. Use flow:to_server for "
181 "inspecting request headers or flow:to_client for "
182 "inspecting response headers.";
192 const uint8_t flow_flags,
void *txv,
const int list_id)
196 htp_tx_t *tx = (htp_tx_t *)txv;
200 const bool ts = ((flow_flags & STREAM_TOSERVER) != 0);
201 const uint8_t *data =
ts ?
205 const uint32_t data_len =
ts ?
209 det_ctx, list_id, buffer, data, data_len, transforms);
222 const uint8_t *b = NULL;
225 if (thread_buf == NULL)
227 if (SCHttp2TxGetHeadersRaw(txv, flow_flags, &b, &b_len, thread_buf) != 1)
229 if (b == NULL || b_len == 0)
261 const int list_id =
ctx->list_id;
264 flags, txv, list_id);
269 const uint8_t *data = buffer->
inspect;
274 if (data != NULL && data_len >= mpm_ctx->
minlen) {
276 mpm_ctx, &det_ctx->
mtc, &det_ctx->
pmq, data, data_len);
293 PrefilterMpmHttpHeaderRaw(det_ctx, pectx, p, f, txv, idx, _txd,
flags);
297 static void PrefilterMpmHttpHeaderRawFree(
void *ptr)
316 HTP_REQUEST_PROGRESS_HEADERS + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->
pname);
323 pectx =
SCCalloc(1,
sizeof(*pectx));
331 HTP_REQUEST_PROGRESS_TRAILER + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->
pname);
352 HTP_RESPONSE_PROGRESS_HEADERS, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->
pname);
359 pectx =
SCCalloc(1,
sizeof(*pectx));
367 HTP_RESPONSE_PROGRESS_TRAILER, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->
pname);