Go to the documentation of this file.
41 static void DetectTransformToSha256RegisterTests(
void);
49 "convert to sha256 hash of the buffer";
51 "/rules/transforms.html#to-sha256";
53 DetectTransformToSha256Setup;
58 DetectTransformToSha256RegisterTests;
76 SCLogError(
"SHA256 hashing has been disabled, "
77 "needed for to_sha256 keyword");
86 const uint8_t *input = buffer->
inspect;
91 SCSha256HashBuffer(input, input_len, output,
sizeof(output));
96 static int DetectTransformToSha256Test01(
void)
98 const uint8_t *input = (
const uint8_t *)
" A B C D ";
99 uint32_t input_len = strlen((
char *)input);
105 TransformToSha256(&buffer, NULL);
111 static void DetectTransformToSha256RegisterTests(
void)
114 DetectTransformToSha256Test01);
SigTableElmt * sigmatch_table
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
main detection engine ctx
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
void InspectionBufferInit(InspectionBuffer *buffer, uint32_t initial_size)
#define PASS
Pass the test.
void PrintRawDataFp(FILE *fp, const uint8_t *buf, uint32_t buflen)
@ DETECT_TRANSFORM_SHA256
void InspectionBufferCopy(InspectionBuffer *buffer, uint8_t *buf, uint32_t buf_len)
void(* Transform)(InspectionBuffer *, void *context)
#define SCLogError(...)
Macro used to log ERROR messages.
void InspectionBufferSetup(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
int DetectSignatureAddTransform(Signature *s, int transform, void *options)
void InspectionBufferFree(InspectionBuffer *buffer)
void(* RegisterTests)(void)