]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
config/ja3: Eliminate warnings when JA3 is disabled 11055/head
authorJeff Lucovsky <jlucovsky@oisf.net>
Thu, 9 May 2024 14:21:48 +0000 (10:21 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 13 May 2024 05:07:19 +0000 (07:07 +0200)
This commit eliminates warnings when either ja3, ja4 or both are
disabled.

rust/src/ja4.rs
src/detect-ja4-hash.c
src/detect-tls-ja3-hash.c
src/detect-tls-ja3-string.c
src/detect-tls-ja3s-hash.c
src/detect-tls-ja3s-string.c

index c876da3ea542683557707db4ff49452950ceff5c..883c00e8c3ca59a2cb93f9da7136cfd6782b7aba 100644 (file)
@@ -23,7 +23,9 @@ use digest::Digest;
 use libc::c_uchar;
 #[cfg(feature = "ja4")]
 use sha2::Sha256;
-use std::{cmp::min, os::raw::c_char};
+#[cfg(feature = "ja4")]
+use std::cmp::min;
+use std::os::raw::c_char;
 use tls_parser::{TlsCipherSuiteID, TlsExtensionType, TlsVersion};
 
 #[derive(Debug, PartialEq)]
index 1de08eeffb9a368034d8e7be690cf22fa264b257..ebddc6b6d06081aacd2f7fdc6fdde2ddec257e6f 100644 (file)
@@ -46,6 +46,7 @@ static int DetectJA4SetupNoSupport(DetectEngineCtx *a, Signature *b, const char
 }
 #endif /* HAVE_JA4 */
 
+#ifdef HAVE_JA4
 static int DetectJa4HashSetup(DetectEngineCtx *, Signature *, const char *);
 static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
         const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv,
@@ -56,6 +57,7 @@ static InspectionBuffer *Ja4DetectGetHash(DetectEngineThreadCtx *det_ctx,
         const int list_id);
 
 static int g_ja4_hash_buffer_id = 0;
+#endif
 
 /**
  * \brief Registration function for keyword: ja4.hash
@@ -93,6 +95,7 @@ void DetectJa4HashRegister(void)
 #endif /* HAVE_JA4 */
 }
 
+#ifdef HAVE_JA4
 /**
  * \brief this function setup the ja4.hash modifier keyword used in the rule
  *
@@ -171,3 +174,4 @@ static InspectionBuffer *Ja4DetectGetHash(DetectEngineThreadCtx *det_ctx,
     }
     return buffer;
 }
+#endif
index 89ca1685097469206d3b6f7572f64776bb2dabd9..57b0e55edeb5e2c4b0830cd56af3437334d14ca8 100644 (file)
@@ -64,6 +64,7 @@ static int DetectJA3SetupNoSupport(DetectEngineCtx *a, Signature *b, const char
 }
 #endif
 
+#ifdef HAVE_JA3
 static int DetectTlsJa3HashSetup(DetectEngineCtx *, Signature *, const char *);
 static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
        const DetectEngineTransforms *transforms,
@@ -74,6 +75,7 @@ static void DetectTlsJa3HashSetupCallback(const DetectEngineCtx *de_ctx,
 static bool DetectTlsJa3HashValidateCallback(const Signature *s,
        const char **sigerror);
 static int g_tls_ja3_hash_buffer_id = 0;
+#endif
 
 /**
  * \brief Registration function for keyword: ja3_hash
@@ -117,6 +119,7 @@ void DetectTlsJa3HashRegister(void)
 #endif /* HAVE_JA3 */
 }
 
+#ifdef HAVE_JA3
 /**
  * \brief this function setup the ja3.hash modifier keyword used in the rule
  *
@@ -239,3 +242,4 @@ static void DetectTlsJa3HashSetupCallback(const DetectEngineCtx *de_ctx,
         }
     }
 }
+#endif
index 0e34afdce411433616f54b26c3318a02f5cdc3f8..1ec289c6e9d188451970081eee2a89c6587752b0 100644 (file)
@@ -64,12 +64,14 @@ static int DetectJA3SetupNoSupport(DetectEngineCtx *a, Signature *b, const char
 }
 #endif /* HAVE_JA3 */
 
+#ifdef HAVE_JA3
 static int DetectTlsJa3StringSetup(DetectEngineCtx *, Signature *, const char *);
 static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
        const DetectEngineTransforms *transforms,
        Flow *f, const uint8_t flow_flags,
        void *txv, const int list_id);
 static int g_tls_ja3_str_buffer_id = 0;
+#endif
 
 /**
  * \brief Registration function for keyword: ja3.string
@@ -107,6 +109,7 @@ void DetectTlsJa3StringRegister(void)
 #endif /* HAVE_JA3 */
 }
 
+#ifdef HAVE_JA3
 /**
  * \brief this function setup the ja3.string modifier keyword used in the rule
  *
@@ -164,3 +167,4 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
 
     return buffer;
 }
+#endif
index f7783002afa187cb33890386efcf57146b109b09..6d3d42e5edf89ac0fc31e54e776b13d6f4689c17 100644 (file)
@@ -64,6 +64,7 @@ static int DetectJA3SetupNoSupport(DetectEngineCtx *a, Signature *b, const char
 }
 #endif /* HAVE_JA3 */
 
+#ifdef HAVE_JA3
 static int DetectTlsJa3SHashSetup(DetectEngineCtx *, Signature *, const char *);
 static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
        const DetectEngineTransforms *transforms,
@@ -74,6 +75,7 @@ static void DetectTlsJa3SHashSetupCallback(const DetectEngineCtx *de_ctx,
 static bool DetectTlsJa3SHashValidateCallback(const Signature *s,
        const char **sigerror);
 static int g_tls_ja3s_hash_buffer_id = 0;
+#endif
 
 /**
  * \brief Registration function for keyword: ja3s.hash
@@ -116,6 +118,7 @@ void DetectTlsJa3SHashRegister(void)
 #endif /* HAVE_JA3 */
 }
 
+#ifdef HAVE_JA3
 /**
  * \brief this function setup the ja3s.hash modifier keyword used in the rule
  *
@@ -237,3 +240,4 @@ static void DetectTlsJa3SHashSetupCallback(const DetectEngineCtx *de_ctx,
         }
     }
 }
+#endif
index 3d9e58db30bb5d77f5158fea91dee70ee37d91e3..0104560627d59d1af9ec81d2182e75cea1b3c8e5 100644 (file)
@@ -64,12 +64,14 @@ static int DetectJA3SetupNoSupport(DetectEngineCtx *a, Signature *b, const char
 }
 #endif /* HAVE_JA3 */
 
+#ifdef HAVE_JA3
 static int DetectTlsJa3SStringSetup(DetectEngineCtx *, Signature *, const char *);
 static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
        const DetectEngineTransforms *transforms,
        Flow *f, const uint8_t flow_flags,
        void *txv, const int list_id);
 static int g_tls_ja3s_str_buffer_id = 0;
+#endif
 
 /**
  * \brief Registration function for keyword: ja3s.string
@@ -107,6 +109,7 @@ void DetectTlsJa3SStringRegister(void)
 #endif /*  HAVE_JA3 */
 }
 
+#ifdef HAVE_JA3
 /**
  * \brief this function setup the ja3s.string modifier keyword used in the rule
  *
@@ -164,3 +167,4 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
 
     return buffer;
 }
+#endif