From 15012fc9085fb9a1ac45cf4c81c71cf38d2cc7bf Mon Sep 17 00:00:00 2001 From: Mats Klepsland Date: Tue, 14 May 2019 08:49:28 +0200 Subject: [PATCH] ja3: check if JA3 is disabled on one line --- src/detect-tls-ja3-hash.c | 5 +---- src/detect-tls-ja3-string.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/detect-tls-ja3-hash.c b/src/detect-tls-ja3-hash.c index 0e20f02e79..3688527796 100644 --- a/src/detect-tls-ja3-hash.c +++ b/src/detect-tls-ja3-hash.c @@ -120,11 +120,8 @@ static int DetectTlsJa3HashSetup(DetectEngineCtx *de_ctx, Signature *s, const ch if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; - if (RunmodeIsUnittests()) - return 0; - /* Check if JA3 is disabled */ - if (Ja3IsDisabled("rule")) + if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) return -1; return 0; diff --git a/src/detect-tls-ja3-string.c b/src/detect-tls-ja3-string.c index c0949271a9..cd2275ec76 100644 --- a/src/detect-tls-ja3-string.c +++ b/src/detect-tls-ja3-string.c @@ -110,11 +110,8 @@ static int DetectTlsJa3StringSetup(DetectEngineCtx *de_ctx, Signature *s, const if (DetectSignatureSetAppProto(s, ALPROTO_TLS) < 0) return -1; - if (RunmodeIsUnittests()) - return 0; - /* Check if JA3 is disabled */ - if (Ja3IsDisabled("rule")) + if (!RunmodeIsUnittests() && Ja3IsDisabled("rule")) return -1; return 0; -- 2.47.3