detect/ssh: move ssh.hassh string to rust

bindgen needed SCSigMatchSilentErrorEnabled on the way
pull/14712/head
Philippe Antoine 8 months ago committed by Victor Julien
parent 27f398b5f2
commit 83360cfce0

@ -15,7 +15,9 @@
* 02110-1301, USA.
*/
use super::ssh::{SSHConnectionState, SSHTransaction, ALPROTO_SSH};
use super::ssh::{
SCSshEnableHassh, SCSshHasshIsEnabled, SSHConnectionState, SSHTransaction, ALPROTO_SSH,
};
use crate::core::{STREAM_TOCLIENT, STREAM_TOSERVER};
use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer};
use crate::direction::Direction;
@ -24,7 +26,7 @@ use std::ptr;
use suricata_sys::sys::{
DetectEngineCtx, SCDetectBufferSetActiveList, SCDetectHelperBufferProgressMpmRegister,
SCDetectHelperKeywordAliasRegister, SCDetectHelperKeywordRegister,
SCDetectSignatureSetAppProto, SCSigTableAppLiteElmt, Signature,
SCDetectSignatureSetAppProto, SCSigMatchSilentErrorEnabled, SCSigTableAppLiteElmt, Signature,
};
#[no_mangle]
@ -115,8 +117,8 @@ pub unsafe extern "C" fn SCSshTxGetHassh(
#[no_mangle]
pub unsafe extern "C" fn SCSshTxGetHasshString(
tx: *mut std::os::raw::c_void, buffer: *mut *const u8, buffer_len: *mut u32, direction: u8,
) -> u8 {
tx: *const c_void, direction: u8, buffer: *mut *const u8, buffer_len: *mut u32,
) -> bool {
let tx = cast_pointer!(tx, SSHTransaction);
match direction.into() {
Direction::ToServer => {
@ -124,7 +126,7 @@ pub unsafe extern "C" fn SCSshTxGetHasshString(
if !m.is_empty() {
*buffer = m.as_ptr();
*buffer_len = m.len() as u32;
return 1;
return true;
}
}
Direction::ToClient => {
@ -132,14 +134,14 @@ pub unsafe extern "C" fn SCSshTxGetHasshString(
if !m.is_empty() {
*buffer = m.as_ptr();
*buffer_len = m.len() as u32;
return 1;
return true;
}
}
}
*buffer = ptr::null();
*buffer_len = 0;
return 0;
return false;
}
unsafe extern "C" fn ssh_software_setup(
@ -166,6 +168,50 @@ unsafe extern "C" fn ssh_proto_setup(
return 0;
}
unsafe extern "C" fn ssh_hassh_string_setup(
de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char,
) -> c_int {
if SCDetectSignatureSetAppProto(s, ALPROTO_SSH) != 0 {
return -1;
}
if SCDetectBufferSetActiveList(de, s, G_SSH_HASSH_STR_BUFFER_ID) < 0 {
return -1;
}
/* try to enable Hassh */
SCSshEnableHassh();
/* Check if Hassh is disabled */
if !SCSshHasshIsEnabled() {
if !SCSigMatchSilentErrorEnabled(de, DETECT_SSH_HASSH_STRING) {
SCLogError!("hassh support is not enabled");
}
return -2;
}
return 0;
}
unsafe extern "C" fn ssh_hassh_server_string_setup(
de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char,
) -> c_int {
if SCDetectSignatureSetAppProto(s, ALPROTO_SSH) != 0 {
return -1;
}
if SCDetectBufferSetActiveList(de, s, G_SSH_HASSH_SRV_STR_BUFFER_ID) < 0 {
return -1;
}
/* try to enable Hassh */
SCSshEnableHassh();
/* Check if Hassh is disabled */
if !SCSshHasshIsEnabled() {
if !SCSigMatchSilentErrorEnabled(de, DETECT_SSH_HASSH_SERVER_STRING) {
SCLogError!("hassh support is not enabled");
}
return -2;
}
return 0;
}
unsafe extern "C" fn ssh_software_obsolete_setup(
_de: *mut DetectEngineCtx, _s: *mut Signature, _raw: *const std::os::raw::c_char,
) -> c_int {
@ -182,6 +228,11 @@ unsafe extern "C" fn ssh_proto_obsolete_setup(
static mut G_SSH_SOFTWARE_BUFFER_ID: c_int = 0;
static mut G_SSH_PROTO_BUFFER_ID: c_int = 0;
static mut G_SSH_HASSH_STR_BUFFER_ID: c_int = 0;
static mut G_SSH_HASSH_SRV_STR_BUFFER_ID: c_int = 0;
static mut DETECT_SSH_HASSH_STRING: u16 = 0;
static mut DETECT_SSH_HASSH_SERVER_STRING: u16 = 0;
#[no_mangle]
pub unsafe extern "C" fn SCDetectSshRegister() {
@ -246,4 +297,44 @@ pub unsafe extern "C" fn SCDetectSshRegister() {
ssh_proto_kw_id,
b"ssh_proto\0".as_ptr() as *const libc::c_char,
);
let kw = SigTableElmtStickyBuffer {
name: String::from("ssh.hassh.string"),
desc: String::from("ssh.hassh.string sticky buffer"),
url: String::from("/rules/ssh-keywords.html#hassh.string"),
setup: ssh_hassh_string_setup,
};
DETECT_SSH_HASSH_STRING = helper_keyword_register_sticky_buffer(&kw);
G_SSH_HASSH_STR_BUFFER_ID = SCDetectHelperBufferProgressMpmRegister(
b"ssh.hassh.string\0".as_ptr() as *const libc::c_char,
b"Ssh Client Key Exchange methods For ssh Clients\0".as_ptr() as *const libc::c_char,
ALPROTO_SSH,
STREAM_TOSERVER,
Some(SCSshTxGetHasshString),
SSHConnectionState::SshStateBannerDone as c_int,
);
SCDetectHelperKeywordAliasRegister(
DETECT_SSH_HASSH_STRING,
b"ssh-hassh-string\0".as_ptr() as *const libc::c_char,
);
let kw = SigTableElmtStickyBuffer {
name: String::from("ssh.hassh.server.string"),
desc: String::from("ssh.hassh.server.string sticky buffer"),
url: String::from("/rules/ssh-keywords.html#ssh.hassh.server.string"),
setup: ssh_hassh_server_string_setup,
};
DETECT_SSH_HASSH_SERVER_STRING = helper_keyword_register_sticky_buffer(&kw);
G_SSH_HASSH_SRV_STR_BUFFER_ID = SCDetectHelperBufferProgressMpmRegister(
b"ssh.hassh.server.string\0".as_ptr() as *const libc::c_char,
b"Ssh Client Key Exchange methods For ssh Servers\0".as_ptr() as *const libc::c_char,
ALPROTO_SSH,
STREAM_TOCLIENT,
Some(SCSshTxGetHasshString),
SSHConnectionState::SshStateBannerDone as c_int,
);
SCDetectHelperKeywordAliasRegister(
DETECT_SSH_HASSH_SERVER_STRING,
b"ssh-hassh-server-string\0".as_ptr() as *const libc::c_char,
);
}

@ -548,6 +548,9 @@ extern "C" {
arg5: ::std::os::raw::c_int,
) -> *mut SigMatch;
}
extern "C" {
pub fn SCSigMatchSilentErrorEnabled(de_ctx: *const DetectEngineCtx, id: u16) -> bool;
}
extern "C" {
pub fn SCDetectSignatureSetAppProto(
s: *mut Signature, alproto: AppProto,

@ -283,9 +283,7 @@ noinst_HEADERS = \
detect-smb-share.h \
detect-smb-version.h \
detect-smtp.h \
detect-ssh-hassh-server-string.h \
detect-ssh-hassh-server.h \
detect-ssh-hassh-string.h \
detect-ssh-hassh.h \
detect-ssl-state.h \
detect-ssl-version.h \
@ -879,9 +877,7 @@ libsuricata_c_a_SOURCES = \
detect-smb-share.c \
detect-smb-version.c \
detect-smtp.c \
detect-ssh-hassh-server-string.c \
detect-ssh-hassh-server.c \
detect-ssh-hassh-string.c \
detect-ssh-hassh.c \
detect-ssl-state.c \
detect-ssl-version.c \

@ -236,8 +236,6 @@
#include "detect-tls-version.h"
#include "detect-ssh-hassh.h"
#include "detect-ssh-hassh-server.h"
#include "detect-ssh-hassh-string.h"
#include "detect-ssh-hassh-server-string.h"
#include "detect-http-stat-code.h"
#include "detect-ssl-version.h"
#include "detect-ssl-state.h"
@ -712,8 +710,6 @@ void SigTableSetup(void)
DetectAsn1Register();
DetectSshHasshRegister();
DetectSshHasshServerRegister();
DetectSshHasshStringRegister();
DetectSshHasshServerStringRegister();
DetectSslStateRegister();
DetectSslVersionRegister();
DetectByteExtractRegister();

@ -191,8 +191,6 @@ enum DetectKeywordId {
DETECT_NFS_VERSION,
DETECT_SSH_HASSH,
DETECT_SSH_HASSH_SERVER,
DETECT_SSH_HASSH_STRING,
DETECT_SSH_HASSH_SERVER_STRING,
DETECT_SSL_VERSION,
DETECT_SSL_STATE,
DETECT_FILE_DATA,

@ -127,7 +127,7 @@ static int DetectJa4HashSetup(DetectEngineCtx *de_ctx, Signature *s, const char
/* check if JA4 enabling had an effect */
if (!RunmodeIsUnittests() && !SSLJA4IsEnabled()) {
if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_JA4_HASH)) {
if (!SCSigMatchSilentErrorEnabled(de_ctx, DETECT_JA4_HASH)) {
SCLogError("JA4 support is not enabled");
}
return -2;

@ -327,8 +327,7 @@ static SigTableElmt *SigTableGet(char *name)
return NULL;
}
bool SigMatchSilentErrorEnabled(const DetectEngineCtx *de_ctx,
const enum DetectKeywordId id)
bool SCSigMatchSilentErrorEnabled(const DetectEngineCtx *de_ctx, uint16_t id)
{
return de_ctx->sm_types_silent_error[id];
}

@ -69,8 +69,7 @@ int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx,
Signature *s, const char *arg, int sm_type, int sm_list,
AppProto alproto);
bool SigMatchSilentErrorEnabled(const DetectEngineCtx *de_ctx,
const enum DetectKeywordId id);
bool SCSigMatchSilentErrorEnabled(const DetectEngineCtx *de_ctx, uint16_t id);
bool SigMatchStrictEnabled(const enum DetectKeywordId id);
const char *DetectListToHumanString(int list);

@ -1,141 +0,0 @@
/* Copyright (C) 2007-2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/**
* \file
*
* \author Vadym Malakhatko <v.malakhatko@sirinsoftware.com>
*/
#include "suricata-common.h"
#include "threads.h"
#include "decode.h"
#include "detect.h"
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-buffer.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "detect-engine-prefilter.h"
#include "flow.h"
#include "flow-var.h"
#include "flow-util.h"
#include "stream-tcp.h"
#include "util-debug.h"
#include "util-unittest.h"
#include "util-unittest-helper.h"
#include "app-layer.h"
#include "app-layer-parser.h"
#include "app-layer-ssh.h"
#include "detect-ssh-hassh-server-string.h"
#include "rust.h"
#define KEYWORD_NAME "ssh.hassh.server.string"
#define KEYWORD_ALIAS "ssh-hassh-server-string"
#define KEYWORD_DOC "ssh-keywords.html#ssh.hassh.server.string"
#define BUFFER_NAME "ssh.hassh.server.string"
#define BUFFER_DESC "Ssh Client Key Exchange methods For ssh Servers"
static int g_ssh_hassh_server_string_buffer_id = 0;
static InspectionBuffer *GetSshData(DetectEngineThreadCtx *det_ctx,
const DetectEngineTransforms *transforms, Flow *_f,
const uint8_t flow_flags, void *txv, const int list_id)
{
SCEnter();
InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id);
if (buffer->inspect == NULL) {
const uint8_t *hassh = NULL;
uint32_t b_len = 0;
if (SCSshTxGetHasshString(txv, &hassh, &b_len, flow_flags) != 1)
return NULL;
if (hassh == NULL || b_len == 0) {
SCLogDebug("SSH hassh string is not set");
return NULL;
}
InspectionBufferSetupAndApplyTransforms(det_ctx, list_id, buffer, hassh, b_len, transforms);
}
return buffer;
}
/**
* \brief this function setup the ssh.hassh.server.string modifier keyword used in the rule
*
* \param de_ctx Pointer to the Detection Engine Context
* \param s Pointer to the Signature to which the current keyword belongs
* \param str Should hold an empty string always
*
* \retval 0 On success
* \retval -1 On failure
* \retval -2 on failure that should be silent after the first
*/
static int DetectSshHasshServerStringSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
{
if (SCDetectBufferSetActiveList(de_ctx, s, g_ssh_hassh_server_string_buffer_id) < 0)
return -1;
if (SCDetectSignatureSetAppProto(s, ALPROTO_SSH) < 0)
return -1;
/* try to enable Hassh */
SCSshEnableHassh();
/* Check if Hassh is disabled */
if (!RunmodeIsUnittests() && !SCSshHasshIsEnabled()) {
if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_SSH_HASSH_SERVER_STRING)) {
SCLogError("hassh support is not enabled");
}
return -2;
}
return 0;
}
/**
* \brief Registration function for hasshServer.string keyword.
*/
void DetectSshHasshServerStringRegister(void)
{
sigmatch_table[DETECT_SSH_HASSH_SERVER_STRING].name = KEYWORD_NAME;
sigmatch_table[DETECT_SSH_HASSH_SERVER_STRING].alias = KEYWORD_ALIAS;
sigmatch_table[DETECT_SSH_HASSH_SERVER_STRING].desc = BUFFER_NAME " sticky buffer";
sigmatch_table[DETECT_SSH_HASSH_SERVER_STRING].url = "/rules/" KEYWORD_DOC;
sigmatch_table[DETECT_SSH_HASSH_SERVER_STRING].Setup = DetectSshHasshServerStringSetup;
sigmatch_table[DETECT_SSH_HASSH_SERVER_STRING].flags |=
SIGMATCH_INFO_STICKY_BUFFER | SIGMATCH_NOOPT;
DetectAppLayerMpmRegister(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, PrefilterGenericMpmRegister,
GetSshData, ALPROTO_SSH, SshStateBannerDone);
DetectAppLayerInspectEngineRegister(BUFFER_NAME, ALPROTO_SSH, SIG_FLAG_TOCLIENT,
SshStateBannerDone, DetectEngineInspectBufferGeneric, GetSshData);
DetectBufferTypeSetDescriptionByName(BUFFER_NAME, BUFFER_DESC);
g_ssh_hassh_server_string_buffer_id = DetectBufferTypeGetByName(BUFFER_NAME);
}

@ -1,30 +0,0 @@
/* Copyright (C) 2007-2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/**
* \file
*
* \author Malakhatko Vadym <v.malakhatko@sirinsoftware.com>
*/
#ifndef SURICATA_DETECT_SSH_HASSH_SERVER_STRING_H
#define SURICATA_DETECT_SSH_HASSH_SERVER_STRING_H
/* prototypes */
void DetectSshHasshServerStringRegister (void);
#endif /* SURICATA_DETECT_SSH_HASSH_SERVER_STRING_H */

@ -109,7 +109,7 @@ static int DetectSshHasshServerSetup(DetectEngineCtx *de_ctx, Signature *s, cons
/* Check if Hassh is disabled */
if (!RunmodeIsUnittests() && !SCSshHasshIsEnabled()) {
if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_SSH_HASSH_SERVER)) {
if (!SCSigMatchSilentErrorEnabled(de_ctx, DETECT_SSH_HASSH_SERVER)) {
SCLogError("hassh support is not enabled");
}
return -2;

@ -1,140 +0,0 @@
/* Copyright (C) 2007-2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/**
* \file
*
* \author Vadym Malakhatko <v.malakhatko@sirinsoftware.com>
*/
#include "suricata-common.h"
#include "threads.h"
#include "decode.h"
#include "detect.h"
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-buffer.h"
#include "detect-engine-mpm.h"
#include "detect-engine-state.h"
#include "detect-engine-prefilter.h"
#include "flow.h"
#include "flow-var.h"
#include "flow-util.h"
#include "util-debug.h"
#include "util-unittest.h"
#include "util-unittest-helper.h"
#include "stream-tcp.h"
#include "app-layer.h"
#include "app-layer-parser.h"
#include "app-layer-ssh.h"
#include "detect-ssh-hassh-string.h"
#include "rust.h"
#define KEYWORD_NAME "ssh.hassh.string"
#define KEYWORD_ALIAS "ssh-hassh-string"
#define KEYWORD_DOC "ssh-keywords.html#hassh.string"
#define BUFFER_NAME "ssh.hassh.string"
#define BUFFER_DESC "Ssh Client Key Exchange methods For ssh Clients "
static int g_ssh_hassh_string_buffer_id = 0;
static InspectionBuffer *GetSshData(DetectEngineThreadCtx *det_ctx,
const DetectEngineTransforms *transforms, Flow *_f,
const uint8_t flow_flags, void *txv, const int list_id)
{
SCEnter();
InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id);
if (buffer->inspect == NULL) {
const uint8_t *hassh = NULL;
uint32_t b_len = 0;
if (SCSshTxGetHasshString(txv, &hassh, &b_len, flow_flags) != 1)
return NULL;
if (hassh == NULL || b_len == 0) {
SCLogDebug("SSH hassh string is not set");
return NULL;
}
InspectionBufferSetupAndApplyTransforms(det_ctx, list_id, buffer, hassh, b_len, transforms);
}
return buffer;
}
/**
* \brief this function setup the hassh.string modifier keyword used in the rule
*
* \param de_ctx Pointer to the Detection Engine Context
* \param s Pointer to the Signature to which the current keyword belongs
* \param str Should hold an empty string always
*
* \retval 0 On success
* \retval -1 On failure
* \retval -2 on failure that should be silent after the first
*/
static int DetectSshHasshStringSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
{
if (SCDetectBufferSetActiveList(de_ctx, s, g_ssh_hassh_string_buffer_id) < 0)
return -1;
if (SCDetectSignatureSetAppProto(s, ALPROTO_SSH) < 0)
return -1;
/* try to enable Hassh */
SCSshEnableHassh();
/* Check if Hassh is disabled */
if (!RunmodeIsUnittests() && !SCSshHasshIsEnabled()) {
if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_SSH_HASSH_STRING)) {
SCLogError("hassh support is not enabled");
}
return -2;
}
return 0;
}
/**
* \brief Registration function for hassh.string keyword.
*/
void DetectSshHasshStringRegister(void)
{
sigmatch_table[DETECT_SSH_HASSH_STRING].name = KEYWORD_NAME;
sigmatch_table[DETECT_SSH_HASSH_STRING].alias = KEYWORD_ALIAS;
sigmatch_table[DETECT_SSH_HASSH_STRING].desc = BUFFER_NAME " sticky buffer";
sigmatch_table[DETECT_SSH_HASSH_STRING].url = "/rules/" KEYWORD_DOC;
sigmatch_table[DETECT_SSH_HASSH_STRING].Setup = DetectSshHasshStringSetup;
sigmatch_table[DETECT_SSH_HASSH_STRING].flags |= SIGMATCH_INFO_STICKY_BUFFER | SIGMATCH_NOOPT;
DetectAppLayerMpmRegister(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister,
GetSshData, ALPROTO_SSH, SshStateBannerDone);
DetectAppLayerInspectEngineRegister(BUFFER_NAME, ALPROTO_SSH, SIG_FLAG_TOSERVER,
SshStateBannerDone, DetectEngineInspectBufferGeneric, GetSshData);
DetectBufferTypeSetDescriptionByName(BUFFER_NAME, BUFFER_DESC);
g_ssh_hassh_string_buffer_id = DetectBufferTypeGetByName(BUFFER_NAME);
}

@ -1,30 +0,0 @@
/* Copyright (C) 2007-2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/**
* \file
*
* \author Vadym Malakhatko <v.malakhatko@sirinsoftware.com>
*/
#ifndef SURICATA_DETECT_SSH_HASSH_STRING_H
#define SURICATA_DETECT_SSH_HASSH_STRING_H
/* prototypes */
void DetectSshHasshStringRegister (void);
#endif /* SURICATA_DETECT_SSH_HASSH_STRING_H */

@ -108,7 +108,7 @@ static int DetectSshHasshSetup(DetectEngineCtx *de_ctx, Signature *s, const char
/* Check if Hassh is disabled */
if (!RunmodeIsUnittests() && !SCSshHasshIsEnabled()) {
if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_SSH_HASSH)) {
if (!SCSigMatchSilentErrorEnabled(de_ctx, DETECT_SSH_HASSH)) {
SCLogError("hassh support is not enabled");
}
return -2;

@ -144,7 +144,7 @@ static int DetectTlsJa3HashSetup(DetectEngineCtx *de_ctx, Signature *s, const ch
/* Check if JA3 is disabled */
if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) {
if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_TLS_JA3_HASH)) {
if (!SCSigMatchSilentErrorEnabled(de_ctx, DETECT_TLS_JA3_HASH)) {
SCLogError("ja3 support is not enabled");
}
return -2;

@ -137,7 +137,7 @@ static int DetectTlsJa3StringSetup(DetectEngineCtx *de_ctx, Signature *s, const
/* Check if JA3 is disabled */
if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) {
if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_TLS_JA3_STRING)) {
if (!SCSigMatchSilentErrorEnabled(de_ctx, DETECT_TLS_JA3_STRING)) {
SCLogError("ja3(s) support is not enabled");
}
return -2;

@ -142,7 +142,7 @@ static int DetectTlsJa3SHashSetup(DetectEngineCtx *de_ctx, Signature *s, const c
/* Check if JA3 is disabled */
if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) {
if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_TLS_JA3S_HASH)) {
if (!SCSigMatchSilentErrorEnabled(de_ctx, DETECT_TLS_JA3S_HASH)) {
SCLogError("ja3(s) support is not enabled");
}
return -2;

@ -136,7 +136,7 @@ static int DetectTlsJa3SStringSetup(DetectEngineCtx *de_ctx, Signature *s, const
/* Check if JA3 is disabled */
if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) {
if (!SigMatchSilentErrorEnabled(de_ctx, DETECT_TLS_JA3S_STRING)) {
if (!SCSigMatchSilentErrorEnabled(de_ctx, DETECT_TLS_JA3S_STRING)) {
SCLogError("ja3(s) support is not enabled");
}
return -2;

@ -144,7 +144,7 @@ static int LuaSshTxGetHasshString(lua_State *L, uint8_t flags)
lua_pushnil(L);
return 1;
}
if (SCSshTxGetHasshString(ltx->tx, &buf, &b_len, flags) != 1) {
if (SCSshTxGetHasshString(ltx->tx, flags, &buf, &b_len) != 1) {
lua_pushnil(L);
return 1;
}

Loading…
Cancel
Save