|
|
@ -201,13 +201,11 @@ static int RunTest(struct TestSteps *steps, const char *sig, const char *yaml)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TcpSession ssn;
|
|
|
|
TcpSession ssn;
|
|
|
|
Flow f;
|
|
|
|
Flow f;
|
|
|
|
Packet *p = NULL;
|
|
|
|
|
|
|
|
ThreadVars th_v;
|
|
|
|
ThreadVars th_v;
|
|
|
|
DetectEngineCtx *de_ctx = NULL;
|
|
|
|
|
|
|
|
DetectEngineThreadCtx *det_ctx = NULL;
|
|
|
|
DetectEngineThreadCtx *det_ctx = NULL;
|
|
|
|
int result = 0;
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
AppLayerParserThreadCtx *alp_tctx = AppLayerParserThreadCtxAlloc();
|
|
|
|
AppLayerParserThreadCtx *alp_tctx = AppLayerParserThreadCtxAlloc();
|
|
|
|
|
|
|
|
FAIL_IF_NULL(alp_tctx);
|
|
|
|
|
|
|
|
|
|
|
|
memset(&th_v, 0, sizeof(th_v));
|
|
|
|
memset(&th_v, 0, sizeof(th_v));
|
|
|
|
memset(&f, 0, sizeof(f));
|
|
|
|
memset(&f, 0, sizeof(f));
|
|
|
|
memset(&ssn, 0, sizeof(ssn));
|
|
|
|
memset(&ssn, 0, sizeof(ssn));
|
|
|
@ -224,9 +222,9 @@ static int RunTest(struct TestSteps *steps, const char *sig, const char *yaml)
|
|
|
|
|
|
|
|
|
|
|
|
StreamTcpInitConfig(TRUE);
|
|
|
|
StreamTcpInitConfig(TRUE);
|
|
|
|
|
|
|
|
|
|
|
|
de_ctx = DetectEngineCtxInit();
|
|
|
|
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
|
|
|
|
if (de_ctx == NULL)
|
|
|
|
FAIL_IF_NULL(de_ctx);
|
|
|
|
goto end;
|
|
|
|
de_ctx->flags |= DE_QUIET;
|
|
|
|
|
|
|
|
|
|
|
|
FLOW_INITIALIZE(&f);
|
|
|
|
FLOW_INITIALIZE(&f);
|
|
|
|
f.protoctx = (void *)&ssn;
|
|
|
|
f.protoctx = (void *)&ssn;
|
|
|
@ -235,76 +233,53 @@ static int RunTest(struct TestSteps *steps, const char *sig, const char *yaml)
|
|
|
|
f.alproto = ALPROTO_HTTP;
|
|
|
|
f.alproto = ALPROTO_HTTP;
|
|
|
|
|
|
|
|
|
|
|
|
SCLogDebug("sig %s", sig);
|
|
|
|
SCLogDebug("sig %s", sig);
|
|
|
|
DetectEngineAppendSig(de_ctx, (char *)sig);
|
|
|
|
Signature *s = DetectEngineAppendSig(de_ctx, (char *)sig);
|
|
|
|
|
|
|
|
FAIL_IF_NULL(s);
|
|
|
|
de_ctx->flags |= DE_QUIET;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (de_ctx->sig_list == NULL)
|
|
|
|
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SigGroupBuild(de_ctx);
|
|
|
|
SigGroupBuild(de_ctx);
|
|
|
|
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
|
|
|
|
DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
|
|
|
|
|
|
|
|
FAIL_IF_NULL(det_ctx);
|
|
|
|
|
|
|
|
|
|
|
|
struct TestSteps *b = steps;
|
|
|
|
struct TestSteps *b = steps;
|
|
|
|
i = 0;
|
|
|
|
int i = 0;
|
|
|
|
while (b->input != NULL) {
|
|
|
|
while (b->input != NULL) {
|
|
|
|
SCLogDebug("chunk %p %d", b, i);
|
|
|
|
SCLogDebug("chunk %p %d", b, i);
|
|
|
|
p = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
|
|
|
|
Packet *p = UTHBuildPacket(NULL, 0, IPPROTO_TCP);
|
|
|
|
if (p == NULL)
|
|
|
|
FAIL_IF_NULL(p);
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
p->flow = &f;
|
|
|
|
p->flow = &f;
|
|
|
|
p->flowflags = (b->direction == STREAM_TOSERVER) ? FLOW_PKT_TOSERVER : FLOW_PKT_TOCLIENT;
|
|
|
|
p->flowflags = (b->direction == STREAM_TOSERVER) ? FLOW_PKT_TOSERVER : FLOW_PKT_TOCLIENT;
|
|
|
|
p->flowflags |= FLOW_PKT_ESTABLISHED;
|
|
|
|
p->flowflags |= FLOW_PKT_ESTABLISHED;
|
|
|
|
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
|
|
|
|
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
|
|
|
|
|
|
|
|
|
|
|
|
FLOWLOCK_WRLOCK(&f);
|
|
|
|
|
|
|
|
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP,
|
|
|
|
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP,
|
|
|
|
b->direction, (uint8_t *)b->input,
|
|
|
|
b->direction, (uint8_t *)b->input,
|
|
|
|
b->input_size ? b->input_size : strlen((const char *)b->input));
|
|
|
|
b->input_size ? b->input_size : strlen((const char *)b->input));
|
|
|
|
if (r != 0) {
|
|
|
|
FAIL_IF_NOT(r == 0);
|
|
|
|
printf("toserver chunk %d returned %" PRId32 ", expected 0: ", i+1, r);
|
|
|
|
|
|
|
|
result = 0;
|
|
|
|
|
|
|
|
FLOWLOCK_UNLOCK(&f);
|
|
|
|
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
FLOWLOCK_UNLOCK(&f);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* do detect */
|
|
|
|
/* do detect */
|
|
|
|
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
|
|
|
|
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
|
|
|
|
|
|
|
|
|
|
|
|
int match = PacketAlertCheck(p, 1);
|
|
|
|
int match = PacketAlertCheck(p, 1);
|
|
|
|
if (b->expect != match) {
|
|
|
|
FAIL_IF_NOT(b->expect == match);
|
|
|
|
printf("rule matching mismatch: ");
|
|
|
|
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UTHFreePackets(&p, 1);
|
|
|
|
UTHFreePackets(&p, 1);
|
|
|
|
p = NULL;
|
|
|
|
|
|
|
|
b++;
|
|
|
|
b++;
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end:
|
|
|
|
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StreamTcpFreeConfig(TRUE);
|
|
|
|
StreamTcpFreeConfig(TRUE);
|
|
|
|
FLOW_DESTROY(&f);
|
|
|
|
FLOW_DESTROY(&f);
|
|
|
|
UTHFreePackets(&p, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (yaml) {
|
|
|
|
if (yaml) {
|
|
|
|
HtpConfigRestoreBackup();
|
|
|
|
HtpConfigRestoreBackup();
|
|
|
|
ConfRestoreContextBackup();
|
|
|
|
ConfRestoreContextBackup();
|
|
|
|
EngineModeSetIDS();
|
|
|
|
EngineModeSetIDS();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
PASS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int DetectEngineHttpServerBodyTest01(void)
|
|
|
|
static int DetectEngineHttpServerBodyTest01(void)
|
|
|
@ -423,10 +398,6 @@ static int DetectEngineHttpServerBodyTest01(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -539,10 +510,6 @@ static int DetectEngineHttpServerBodyTest02(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -682,10 +649,6 @@ static int DetectEngineHttpServerBodyTest03(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -812,10 +775,6 @@ static int DetectEngineHttpServerBodyTest04(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -942,10 +901,6 @@ static int DetectEngineHttpServerBodyTest05(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -1072,10 +1027,6 @@ static int DetectEngineHttpServerBodyTest06(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -1202,10 +1153,6 @@ static int DetectEngineHttpServerBodyTest07(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -1332,10 +1279,6 @@ static int DetectEngineHttpServerBodyTest08(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -1463,10 +1406,6 @@ static int DetectEngineHttpServerBodyTest09(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -1594,10 +1533,6 @@ static int DetectEngineHttpServerBodyTest10(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -1725,10 +1660,6 @@ static int DetectEngineHttpServerBodyTest11(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -1856,10 +1787,6 @@ static int DetectEngineHttpServerBodyTest12(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -1987,10 +1914,6 @@ static int DetectEngineHttpServerBodyTest13(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -2118,10 +2041,6 @@ static int DetectEngineHttpServerBodyTest14(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -2249,10 +2168,6 @@ static int DetectEngineHttpServerBodyTest15(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -2428,10 +2343,6 @@ end:
|
|
|
|
HtpConfigRestoreBackup();
|
|
|
|
HtpConfigRestoreBackup();
|
|
|
|
ConfRestoreContextBackup();
|
|
|
|
ConfRestoreContextBackup();
|
|
|
|
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -2607,10 +2518,6 @@ end:
|
|
|
|
HtpConfigRestoreBackup();
|
|
|
|
HtpConfigRestoreBackup();
|
|
|
|
ConfRestoreContextBackup();
|
|
|
|
ConfRestoreContextBackup();
|
|
|
|
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -2741,10 +2648,6 @@ static int DetectEngineHttpServerBodyTest18(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -2873,10 +2776,6 @@ static int DetectEngineHttpServerBodyTest19(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -3004,10 +2903,6 @@ static int DetectEngineHttpServerBodyTest20(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -3137,10 +3032,6 @@ static int DetectEngineHttpServerBodyTest21(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -3272,10 +3163,6 @@ static int DetectEngineHttpServerBodyTest22(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -3403,10 +3290,6 @@ static int DetectEngineHttpServerBodyFileDataTest01(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -3534,10 +3417,6 @@ static int DetectEngineHttpServerBodyFileDataTest02(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
@ -3673,10 +3552,6 @@ static int DetectEngineHttpServerBodyFileDataTest03(void)
|
|
|
|
end:
|
|
|
|
end:
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
if (alp_tctx != NULL)
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
AppLayerParserThreadCtxFree(alp_tctx);
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigGroupCleanup(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
|
|
|
|
SigCleanSignatures(de_ctx);
|
|
|
|
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
if (de_ctx != NULL)
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
DetectEngineCtxFree(de_ctx);
|
|
|
|
|
|
|
|
|
|
|
|