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)
81 "alert smtp any any -> any any (msg:\"DetectBase64DataSetupTest\"; "
82 "base64_decode; base64_data; content:\"content\"; sid:1; rev:1;)");
84 printf(
"SigInit failed: ");
90 printf(
"DETECT_SM_LIST_PMATCH should not be NULL: ");
94 printf(
"sm->type should be DETECT_BASE64_DECODE: ");
99 printf(
"DETECT_SM_LIST_BASE64_DATA should not be NULL: ");
117 static int DetectBase64DataSetupTest04(
void)
129 "alert tcp any any -> any any (msg:\"some b64thing\"; flow:established,from_server; file_data; content:\"sometext\"; fast_pattern; base64_decode:relative; base64_data; content:\"foobar\"; nocase; tag:session,120,seconds; sid:1111111; rev:1;)");
131 printf(
"SigInit failed: ");
145 static void DetectBase64DataRegisterTests(
void)
149 UtRegisterTest(
"DetectBase64DataSetupTest01", DetectBase64DataSetupTest01);
150 UtRegisterTest(
"DetectBase64DataSetupTest04", DetectBase64DataSetupTest04);
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::
void SigCleanSignatures(DetectEngineCtx *de_ctx)
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
int DetectBufferTypeGetByName(const char *name)
@ DETECT_SM_LIST_BASE64_DATA
Signature * SigInit(DetectEngineCtx *de_ctx, const char *sigstr)
Parses a signature and adds it to the Detection Engine Context.
int SigGroupCleanup(DetectEngineCtx *de_ctx)
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)