Go to the documentation of this file.
30 static void DetectBase64DataRegisterTests(
void);
37 "Content match base64 decoded data.";
39 "/rules/base64-keywords.html#base64-data";
43 DetectBase64DataRegisterTests;
56 SCLogError(
"\"base64_data\" keyword seen without preceding base64_decode.");
66 static int g_file_data_buffer_id = 0;
68 static int DetectBase64DataSetupTest01(
void)
75 "alert smtp any any -> any any (msg:\"DetectBase64DataSetupTest\"; "
76 "base64_decode; base64_data; content:\"content\"; sid:1; rev:1;)");
92 static int DetectBase64DataSetupTest04(
void)
99 "alert tcp any any -> any any (msg:\"some b64thing\"; flow:established,from_server; "
100 "file_data; content:\"sometext\"; fast_pattern; base64_decode:relative; base64_data; "
101 "content:\"foobar\"; nocase; tag:session,120,seconds; sid:1111111; rev:1;)");
108 static void DetectBase64DataRegisterTests(
void)
112 UtRegisterTest(
"DetectBase64DataSetupTest01", DetectBase64DataSetupTest01);
113 UtRegisterTest(
"DetectBase64DataSetupTest04", DetectBase64DataSetupTest04);
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
struct SigMatch_ * smlists[DETECT_SM_LIST_MAX]
SigTableElmt * sigmatch_table
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
main detection engine ctx
void DetectEngineCtxFree(DetectEngineCtx *)
Free a DetectEngineCtx::
Signature * DetectEngineAppendSig(DetectEngineCtx *, const char *)
Parse and append a Signature into the Detection Engine Context signature list.
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
int DetectBufferTypeGetByName(const char *name)
#define PASS
Pass the test.
@ DETECT_SM_LIST_BASE64_DATA
SignatureInitData * init_data
void DetectBase64DataRegister(void)
#define SCLogError(...)
Macro used to log ERROR messages.
a single match condition for a signature
DetectEngineCtx * DetectEngineCtxInit(void)
SigMatch * DetectGetLastSMFromLists(const Signature *s,...)
Returns the sm with the largest index (added latest) from the lists passed to us.
void(* RegisterTests)(void)