]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ja3: check if JA3 is disabled on one line
authorMats Klepsland <mats.klepsland@gmail.com>
Tue, 14 May 2019 06:49:28 +0000 (08:49 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 18 May 2019 05:29:23 +0000 (07:29 +0200)
src/detect-tls-ja3-hash.c
src/detect-tls-ja3-string.c

index 0e20f02e799d30e5cff4806987df66ec2f2a958d..3688527796ff076fb6190afd7f2ded4c59a4c1cf 100644 (file)
@@ -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;
index c0949271a95709446aa5c875cb02b8f58c07ee43..cd2275ec762667968e60f77765d2911d42d237df 100644 (file)
@@ -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;