From a4132d8e0f30c1f184b2e3113537afd6f9c86126 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Thu, 11 Jun 2020 08:31:55 -0400 Subject: [PATCH] detect/transform: Add transform "validate" function This commit adds an (optional) entry for a validation function. The validation function, if present, will be used during rule processing. Its role is to determine if the arguments are compatible with the transform. E.g., a content string of "this string has whitespace" is not compatible with the `strip_whitespace` transform. --- src/detect.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/detect.h b/src/detect.h index 3d90519b73..71cdc458b0 100644 --- a/src/detect.h +++ b/src/detect.h @@ -1189,6 +1189,7 @@ typedef struct SigTableElmt_ { /** InspectionBuffer transformation callback */ void (*Transform)(InspectionBuffer *, void *context); + bool (*TransformValidate)(const uint8_t *content, uint16_t content_len, void *context); /** keyword setup function pointer */ int (*Setup)(DetectEngineCtx *, Signature *, const char *);