]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
template: remove -rust references 11929/head
authorPhilippe Antoine <pantoine@oisf.net>
Wed, 9 Oct 2024 12:55:54 +0000 (14:55 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 10 Oct 2024 07:07:48 +0000 (09:07 +0200)
Ticket: 7315

Completes commit 4a7567b3f04075f02543762717dbff9dd5b5c1f3

Allows keyword template.buffer to work properly when template
protocol is enabled

src/detect-template-rust-buffer.c
src/tests/fuzz/confyaml.c

index 16dcbf0c6dfce256a055636e5028f1f8ba3c6632..4b68de6e13fd86061a1ec9d1b402c583df0666d5 100644 (file)
@@ -78,11 +78,11 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
 void DetectTemplateRustBufferRegister(void)
 {
     /* TEMPLATE_START_REMOVE */
-    if (ConfGetNode("app-layer.protocols.template-rust") == NULL) {
+    if (ConfGetNode("app-layer.protocols.template") == NULL) {
         return;
     }
     /* TEMPLATE_END_REMOVE */
-    sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template_rust_buffer";
+    sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template.buffer";
     sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].desc =
             "Template content modifier to match on the template buffers";
     sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].Setup = DetectTemplateRustBufferSetup;
@@ -144,14 +144,14 @@ static int DetectTemplateRustBufferTest(void)
     /* This rule should match. */
     s = DetectEngineAppendSig(de_ctx, "alert tcp any any -> any any ("
                                       "msg:\"TEMPLATE Test Rule\"; "
-                                      "template_rust_buffer; content:\"World!\"; "
+                                      "template.buffer; content:\"World!\"; "
                                       "sid:1; rev:1;)");
     FAIL_IF_NULL(s);
 
     /* This rule should not match. */
     s = DetectEngineAppendSig(de_ctx, "alert tcp any any -> any any ("
                                       "msg:\"TEMPLATE Test Rule\"; "
-                                      "template_rust_buffer; content:\"W0rld!\"; "
+                                      "template.buffer; content:\"W0rld!\"; "
                                       "sid:2; rev:1;)");
     FAIL_IF_NULL(s);
 
index e67e40a3472776669feb6805e729c8c588432f39..f538f32871f7c29546a95667300f8d5ef1bb5d5e 100644 (file)
@@ -85,8 +85,6 @@ app-layer:\n\
       enabled: yes\n\
     template:\n\
       enabled: yes\n\
-    template-rust:\n\
-      enabled: yes\n\
     modbus:\n\
       enabled: yes\n\
       detection-ports:\n\