]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/tls: consolidate validity code
authorVictor Julien <victor@inliniac.net>
Sat, 15 Dec 2018 06:57:25 +0000 (07:57 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 29 Jan 2019 12:27:57 +0000 (13:27 +0100)
src/Makefile.am
src/detect-engine-mpm.c
src/detect-engine-tls.c [deleted file]
src/detect-engine-tls.h [deleted file]
src/detect-tls-cert-validity.c

index 15116d3523223e1d30e8aca1cca349c2c802a7e4..46ef3e604e01ad6dd8fb7969042c8fcec3cc09dc 100644 (file)
@@ -125,7 +125,6 @@ detect-engine-build.c detect-engine-build.h \
 detect-engine-content-inspection.c detect-engine-content-inspection.h \
 detect-engine-dcepayload.c detect-engine-dcepayload.h \
 detect-engine-dns.c detect-engine-dns.h \
-detect-engine-tls.c detect-engine-tls.h \
 detect-engine-modbus.c detect-engine-modbus.h \
 detect-engine-enip.c detect-engine-enip.h \
 detect-engine-event.c detect-engine-event.h \
index c76f3b2d19c2be12bcb109110ab56b804c6c3988..c7aa845cc39d61ef9278dc60cee0cf90f4e286f9 100644 (file)
@@ -51,7 +51,6 @@
 
 #include "detect-engine-payload.h"
 #include "detect-engine-dns.h"
-#include "detect-engine-tls.h"
 
 #include "stream.h"
 
diff --git a/src/detect-engine-tls.c b/src/detect-engine-tls.c
deleted file mode 100644 (file)
index 9a4313f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 2016 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 Mats Klepsland <mats.klepsland@gmail.com>
- *
- */
-
-#include "suricata-common.h"
-#include "suricata.h"
-#include "decode.h"
-
-#include "detect.h"
-#include "detect-engine.h"
-#include "detect-parse.h"
-#include "detect-engine-state.h"
-#include "detect-engine-content-inspection.h"
-#include "detect-engine-prefilter.h"
-
-#include "flow-util.h"
-#include "util-debug.h"
-#include "util-print.h"
-#include "flow.h"
-
-#include "app-layer.h"
-#include "app-layer-parser.h"
-#include "app-layer-protos.h"
-#include "app-layer-ssl.h"
-#include "detect-engine-tls.h"
-
-#include "util-unittest.h"
-#include "util-unittest-helper.h"
-#include "util-validate.h"
-
-int DetectEngineInspectTlsValidity(ThreadVars *tv,
-        DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const Signature *s, const SigMatchData *smd,
-        Flow *f, uint8_t flags, void *alstate,
-        void *txv, uint64_t tx_id)
-{
-    return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
-                                          f, flags, alstate, txv, tx_id);
-}
diff --git a/src/detect-engine-tls.h b/src/detect-engine-tls.h
deleted file mode 100644 (file)
index 63d9c77..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (C) 2016 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 Mats Klepsland <mats.klepsland@gmail.com>
- */
-
-#ifndef __DETECT_ENGINE_TLS_H__
-#define __DETECT_ENGINE_TLS_H__
-
-int DetectEngineInspectTlsValidity(ThreadVars *tv,
-        DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
-        const Signature *s, const SigMatchData *smd,
-        Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
-
-#endif /* __DETECT_ENGINE_TLS_H__ */
index 2ef91e09e1c121858a0aade2567f686ee0779022..bd8ce69008e8b830071123eaaddd337a57c938f9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015 Open Information Security Foundation
+/* Copyright (C) 2015-2018 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
@@ -35,7 +35,6 @@
 #include "detect-content.h"
 #include "detect-pcre.h"
 #include "detect-tls-cert-validity.h"
-#include "detect-engine-tls.h"
 
 #include "flow.h"
 #include "flow-util.h"
@@ -75,6 +74,12 @@ static void TlsValidRegisterTests(void);
 static void DetectTlsValidityFree(void *);
 static int g_tls_validity_buffer_id = 0;
 
+static int DetectEngineInspectTlsValidity(ThreadVars *tv,
+        DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+        const Signature *s, const SigMatchData *smd,
+        Flow *f, uint8_t flags, void *alstate,
+        void *txv, uint64_t tx_id);
+
 /**
  * \brief Registration function for tls validity keywords.
  */
@@ -127,6 +132,15 @@ void DetectTlsValidityRegister (void)
     g_tls_validity_buffer_id = DetectBufferTypeGetByName("tls_validity");
 }
 
+static int DetectEngineInspectTlsValidity(ThreadVars *tv,
+        DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
+        const Signature *s, const SigMatchData *smd,
+        Flow *f, uint8_t flags, void *alstate,
+        void *txv, uint64_t tx_id)
+{
+    return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
+                                          f, flags, alstate, txv, tx_id);
+}
 /**
  * \internal
  * \brief Function to match validity field in a tls certificate.