|
|
|
|
@ -60,6 +60,8 @@ static void DetectHttpRawHeaderRegisterTests(void);
|
|
|
|
|
#endif
|
|
|
|
|
static bool DetectHttpRawHeaderValidateCallback(const Signature *s, const char **sigerror);
|
|
|
|
|
static int g_http_raw_header_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);
|
|
|
|
|
@ -122,6 +124,8 @@ void DetectHttpRawHeaderRegister(void)
|
|
|
|
|
|
|
|
|
|
DetectBufferTypeRegisterValidateCallback("http_raw_header",
|
|
|
|
|
DetectHttpRawHeaderValidateCallback);
|
|
|
|
|
g_http2_thread_id = DetectRegisterThreadCtxGlobalFuncs(
|
|
|
|
|
"http2.raw_header", SCHttp2ThreadBufDataInit, NULL, SCHttp2ThreadBufDataFree);
|
|
|
|
|
|
|
|
|
|
g_http_raw_header_buffer_id = DetectBufferTypeGetByName("http_raw_header");
|
|
|
|
|
}
|
|
|
|
|
@ -213,7 +217,10 @@ static InspectionBuffer *GetData2(DetectEngineThreadCtx *det_ctx,
|
|
|
|
|
uint32_t b_len = 0;
|
|
|
|
|
const uint8_t *b = NULL;
|
|
|
|
|
|
|
|
|
|
if (rs_http2_tx_get_headers_raw(txv, flow_flags, &b, &b_len) != 1)
|
|
|
|
|
void *thread_buf = DetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, g_http2_thread_id);
|
|
|
|
|
if (thread_buf == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
if (SCHttp2TxGetHeadersRaw(txv, flow_flags, &b, &b_len, thread_buf) != 1)
|
|
|
|
|
return NULL;
|
|
|
|
|
if (b == NULL || b_len == 0)
|
|
|
|
|
return NULL;
|
|
|
|
|
|