]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/content: add negated endswith test
authorVictor Julien <vjulien@oisf.net>
Fri, 14 Apr 2023 12:17:53 +0000 (14:17 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 20 Apr 2023 09:06:38 +0000 (11:06 +0200)
(cherry picked from commit a42c225117e7cf815b35b43a4287401817d08f38)

src/tests/detect-engine-content-inspection.c

index ead4d34c0704e6e7f47043fe96b31e3cfa1064d2..39d70c4e2d3c62748d3d1857e4f8b8e59a083c3f 100644 (file)
@@ -254,6 +254,8 @@ static int DetectEngineContentInspectionTest12(void) {
     TEST_RUN("abcXYZ", 6, "content:\"abc\"; content:\"XYZ\"; distance:0; within:3; endswith;", true, 2);
     TEST_RUN("abcXYZ", 6, "content:\"XYZ\"; distance:3; within:3; endswith;", true, 1);
     TEST_RUN("abcXYZ", 6, "content:\"cXY\"; distance:2; within:3; endswith;", false, 1);
+    TEST_RUN("abcXYZ", 6, "content:!\"cXY\"; endswith;", true, 1);
+    TEST_RUN("abcXYZ", 6, "content:!\"XYZ\"; endswith;", false, 1);
 
     TEST_RUN("xxxxxxxxxxxxxxxxxyYYYYYYYYYYYYYYYY", 34, "content:\"yYYYYYYYYYYYYYYYY\"; distance:9; within:29; endswith;", true, 1);
     TEST_FOOTER;