From: Philippe Antoine Date: Wed, 9 Oct 2024 12:55:54 +0000 (+0200) Subject: template: remove -rust references X-Git-Tag: suricata-7.0.8~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9371133e0ea0818b4be337944a1c788020c1d61f;p=thirdparty%2Fsuricata.git template: remove -rust references Ticket: 7315 Completes commit 4a7567b3f04075f02543762717dbff9dd5b5c1f3 Allows keyword template.buffer to work properly when template protocol is enabled (cherry picked from commit 58556b7f8b65b26f97e4e8a95e95ce304fded6c8) --- diff --git a/src/detect-template-rust-buffer.c b/src/detect-template-rust-buffer.c index 86fc282712..41fdf1f67e 100644 --- a/src/detect-template-rust-buffer.c +++ b/src/detect-template-rust-buffer.c @@ -53,11 +53,11 @@ static int g_template_rust_id = 0; 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; @@ -153,14 +153,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); diff --git a/src/tests/fuzz/confyaml.c b/src/tests/fuzz/confyaml.c index e67e40a347..f538f32871 100644 --- a/src/tests/fuzz/confyaml.c +++ b/src/tests/fuzz/confyaml.c @@ -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\