Skip to content

Commit

Permalink
template: remove -rust references
Browse files Browse the repository at this point in the history
Ticket: 7315

Completes commit 4a7567b

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

(cherry picked from commit 58556b7)
  • Loading branch information
catenacyber committed Oct 10, 2024
1 parent 09d3ff9 commit 9371133
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/detect-template-rust-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 0 additions & 2 deletions src/tests/fuzz/confyaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down

0 comments on commit 9371133

Please sign in to comment.