suricata
detect-tls-certs.c
Go to the documentation of this file.
1 /* Copyright (C) 2019-2022 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Mats Klepsland <mats.klepsland@gmail.com>
22  *
23  * Implements support for tls.certs keyword.
24  */
25 
26 #include "suricata-common.h"
27 #include "threads.h"
28 #include "decode.h"
29 #include "detect.h"
30 
31 #include "detect-parse.h"
32 #include "detect-engine.h"
33 #include "detect-engine-mpm.h"
36 #include "detect-content.h"
37 #include "detect-pcre.h"
38 #include "detect-tls-certs.h"
39 #include "detect-engine-uint.h"
40 
41 #include "flow.h"
42 #include "flow-util.h"
43 #include "flow-var.h"
44 
45 #include "util-debug.h"
46 #include "util-spm.h"
47 #include "util-print.h"
48 
49 #include "stream-tcp.h"
50 
51 #include "app-layer.h"
52 #include "app-layer-ssl.h"
53 
54 #include "util-profiling.h"
55 #include "util-unittest.h"
56 #include "util-unittest-helper.h"
57 
58 static int DetectTlsCertsSetup(DetectEngineCtx *, Signature *, const char *);
59 #ifdef UNITTESTS
60 static void DetectTlsCertsRegisterTests(void);
61 #endif
62 static uint8_t DetectEngineInspectTlsCerts(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
63  const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags,
64  void *alstate, void *txv, uint64_t tx_id);
65 static int PrefilterMpmTlsCertsRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx,
66  const DetectBufferMpmRegistry *mpm_reg, int list_id);
67 
68 static int g_tls_certs_buffer_id = 0;
69 
71  uint32_t local_id; /**< used as index into thread inspect array */
73  const uint8_t flags;
74 };
75 
76 typedef struct PrefilterMpmTlsCerts {
77  int list_id;
78  const MpmCtx *mpm_ctx;
81 
82 /**
83  * \brief Registration function for keyword: tls.certs
84  */
86 {
88  sigmatch_table[DETECT_AL_TLS_CERTS].desc = "sticky buffer to match the TLS certificate buffer";
89  sigmatch_table[DETECT_AL_TLS_CERTS].url = "/rules/tls-keywords.html#tls-certs";
90  sigmatch_table[DETECT_AL_TLS_CERTS].Setup = DetectTlsCertsSetup;
91 #ifdef UNITTESTS
92  sigmatch_table[DETECT_AL_TLS_CERTS].RegisterTests = DetectTlsCertsRegisterTests;
93 #endif
96 
98  TLS_STATE_CERT_READY, DetectEngineInspectTlsCerts, NULL);
99 
100  DetectAppLayerMpmRegister("tls.certs", SIG_FLAG_TOCLIENT, 2, PrefilterMpmTlsCertsRegister, NULL,
102 
104  TLS_STATE_CERT_READY, DetectEngineInspectTlsCerts, NULL);
105 
106  DetectAppLayerMpmRegister("tls.certs", SIG_FLAG_TOSERVER, 2, PrefilterMpmTlsCertsRegister, NULL,
108 
109  DetectBufferTypeSetDescriptionByName("tls.certs", "TLS certificate");
110 
112 
113  g_tls_certs_buffer_id = DetectBufferTypeGetByName("tls.certs");
114 }
115 
116 /**
117  * \brief This function setup the tls.certs modifier keyword
118  *
119  * \param de_ctx Pointer to the Detect Engine Context
120  * \param s Pointer to the Signature to which the keyword belongs
121  * \param str Should hold an empty string always
122  *
123  * \retval 0 On success
124  * \retval -1 On failure
125  */
126 static int DetectTlsCertsSetup(DetectEngineCtx *de_ctx, Signature *s,
127  const char *str)
128 {
129  if (DetectBufferSetActiveList(de_ctx, s, g_tls_certs_buffer_id) < 0)
130  return -1;
131 
133  return -1;
134 
135  return 0;
136 }
137 
138 static InspectionBuffer *TlsCertsGetData(DetectEngineThreadCtx *det_ctx,
139  const DetectEngineTransforms *transforms, Flow *f,
140  struct TlsCertsGetDataArgs *cbdata, int list_id)
141 {
142  SCEnter();
143 
144  InspectionBuffer *buffer =
145  InspectionBufferMultipleForListGet(det_ctx, list_id, cbdata->local_id);
146  if (buffer == NULL || buffer->initialized)
147  return buffer;
148 
149  const SSLState *ssl_state = (SSLState *)f->alstate;
150  const SSLStateConnp *connp;
151 
152  if (cbdata->flags & STREAM_TOSERVER) {
153  connp = &ssl_state->client_connp;
154  } else {
155  connp = &ssl_state->server_connp;
156  }
157 
158  if (TAILQ_EMPTY(&connp->certs)) {
160  return NULL;
161  }
162 
163  if (cbdata->cert == NULL) {
164  cbdata->cert = TAILQ_FIRST(&connp->certs);
165  } else {
166  cbdata->cert = TAILQ_NEXT(cbdata->cert, next);
167  }
168  if (cbdata->cert == NULL) {
170  return NULL;
171  }
172 
173  InspectionBufferSetupMulti(buffer, transforms, cbdata->cert->cert_data, cbdata->cert->cert_len);
174 
175  SCReturnPtr(buffer, "InspectionBuffer");
176 }
177 
178 static uint8_t DetectEngineInspectTlsCerts(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
179  const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags,
180  void *alstate, void *txv, uint64_t tx_id)
181 {
182  const DetectEngineTransforms *transforms = NULL;
183  if (!engine->mpm) {
184  transforms = engine->v2.transforms;
185  }
186 
187  struct TlsCertsGetDataArgs cbdata = { .local_id = 0, .cert = NULL, .flags = flags };
188 
189  while (1)
190  {
191  InspectionBuffer *buffer = TlsCertsGetData(det_ctx, transforms, f,
192  &cbdata, engine->sm_list);
193  if (buffer == NULL || buffer->inspect == NULL)
194  break;
195 
196  const bool match = DetectEngineContentInspection(de_ctx, det_ctx, s, engine->smd, NULL, f,
197  buffer->inspect, buffer->inspect_len, buffer->inspect_offset,
199  if (match) {
201  }
202 
203  cbdata.local_id++;
204  }
205 
207 }
208 
209 static void PrefilterTxTlsCerts(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
210  Flow *f, void *txv, const uint64_t idx, const AppLayerTxData *_txd, const uint8_t flags)
211 {
212  SCEnter();
213 
214  const PrefilterMpmTlsCerts *ctx = (const PrefilterMpmTlsCerts *)pectx;
215  const MpmCtx *mpm_ctx = ctx->mpm_ctx;
216  const int list_id = ctx->list_id;
217 
218  struct TlsCertsGetDataArgs cbdata = { .local_id = 0, .cert = NULL, .flags = flags };
219 
220  while (1)
221  {
222  InspectionBuffer *buffer = TlsCertsGetData(det_ctx, ctx->transforms,
223  f, &cbdata, list_id);
224  if (buffer == NULL)
225  break;
226 
227  if (buffer->inspect_len >= mpm_ctx->minlen) {
228  (void)mpm_table[mpm_ctx->mpm_type].Search(
229  mpm_ctx, &det_ctx->mtc, &det_ctx->pmq, buffer->inspect, buffer->inspect_len);
230  PREFILTER_PROFILING_ADD_BYTES(det_ctx, buffer->inspect_len);
231  }
232 
233  cbdata.local_id++;
234  }
235 }
236 
237 static void PrefilterMpmTlsCertsFree(void *ptr)
238 {
239  SCFree(ptr);
240 }
241 
242 static int PrefilterMpmTlsCertsRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx,
243  const DetectBufferMpmRegistry *mpm_reg, int list_id)
244 {
245  PrefilterMpmTlsCerts *pectx = SCCalloc(1, sizeof(*pectx));
246  if (pectx == NULL)
247  return -1;
248 
249  pectx->list_id = list_id;
250  pectx->mpm_ctx = mpm_ctx;
251  pectx->transforms = &mpm_reg->transforms;
252 
253  return PrefilterAppendTxEngine(de_ctx, sgh, PrefilterTxTlsCerts,
254  mpm_reg->app_v2.alproto, mpm_reg->app_v2.tx_min_progress,
255  pectx, PrefilterMpmTlsCertsFree, mpm_reg->name);
256 }
257 
258 static int g_tls_cert_buffer_id = 0;
259 #define BUFFER_NAME "tls_validity"
260 #define KEYWORD_ID DETECT_AL_TLS_CHAIN_LEN
261 #define KEYWORD_NAME "tls.cert_chain_len"
262 #define KEYWORD_DESC "match TLS certificate chain length"
263 #define KEYWORD_URL "/rules/tls-keywords.html#tls-cert-chain-len"
264 
265 /**
266  * \internal
267  * \brief Function to match cert chain length in TLS
268  *
269  * \param t Pointer to thread vars.
270  * \param det_ctx Pointer to the pattern matcher thread.
271  * \param f Pointer to the current flow.
272  * \param flags Flags.
273  * \param state App layer state.
274  * \param s Pointer to the Signature.
275  * \param m Pointer to the sigmatch that we will cast into
276  * DetectU64Data.
277  *
278  * \retval 0 no match.
279  * \retval 1 match.
280  */
281 static int DetectTLSCertChainLenMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags,
282  void *state, void *txv, const Signature *s, const SigMatchCtx *ctx)
283 {
284  SCEnter();
285 
286  SSLState *ssl_state = state;
287  if (flags & STREAM_TOCLIENT) {
288  SSLStateConnp *connp = &ssl_state->server_connp;
289  uint32_t cnt = 0;
291  TAILQ_FOREACH (cert, &connp->certs, next) {
292  cnt++;
293  }
294  SCLogDebug("%u certs in chain", cnt);
295 
296  const DetectU32Data *dd = (const DetectU32Data *)ctx;
297  if (DetectU32Match(cnt, dd)) {
298  SCReturnInt(1);
299  }
300  }
301  SCReturnInt(0);
302 }
303 
304 /**
305  * \internal
306  * \brief Function to free memory associated with DetectU64Data.
307  *
308  * \param de_ptr Pointer to DetectU64Data.
309  */
310 static void DetectTLSCertChainLenFree(DetectEngineCtx *de_ctx, void *ptr)
311 {
312  rs_detect_u32_free(ptr);
313 }
314 
315 /**
316  * \brief Function to add the parsed tls cert chain len field into the current signature.
317  *
318  * \param de_ctx Pointer to the Detection Engine Context.
319  * \param s Pointer to the Current Signature.
320  * \param rawstr Pointer to the user provided flags options.
321  * \param type Defines if this is notBefore or notAfter.
322  *
323  * \retval 0 on Success.
324  * \retval -1 on Failure.
325  */
326 static int DetectTLSCertChainLenSetup(DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
327 {
329  return -1;
330 
331  DetectU32Data *dd = DetectU32Parse(rawstr);
332  if (dd == NULL) {
333  SCLogError("Parsing \'%s\' failed for %s", rawstr, sigmatch_table[KEYWORD_ID].name);
334  return -1;
335  }
336 
337  if (SigMatchAppendSMToList(de_ctx, s, KEYWORD_ID, (SigMatchCtx *)dd, g_tls_cert_buffer_id) ==
338  NULL) {
339  rs_detect_u32_free(dd);
340  return -1;
341  }
342  return 0;
343 }
344 
346 {
350  sigmatch_table[KEYWORD_ID].AppLayerTxMatch = DetectTLSCertChainLenMatch;
351  sigmatch_table[KEYWORD_ID].Setup = DetectTLSCertChainLenSetup;
352  sigmatch_table[KEYWORD_ID].Free = DetectTLSCertChainLenFree;
353 
356 
357  g_tls_cert_buffer_id = DetectBufferTypeGetByName(BUFFER_NAME);
358 }
359 
360 #ifdef UNITTESTS
361 #include "tests/detect-tls-certs.c"
362 #endif
detect-engine-uint.h
DetectEngineAppInspectionEngine_
Definition: detect.h:424
SigTableElmt_::url
const char * url
Definition: detect.h:1296
DetectSignatureSetAppProto
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
Definition: detect-parse.c:1753
SSLState_
SSLv[2.0|3.[0|1|2|3]] state structure.
Definition: app-layer-ssl.h:284
DetectEngineAppInspectionEngine_::mpm
bool mpm
Definition: detect.h:428
detect-content.h
MpmCtx_::mpm_type
uint8_t mpm_type
Definition: util-mpm.h:90
detect-engine.h
TlsCertsGetDataArgs::flags
const uint8_t flags
Definition: detect-tls-certs.c:73
SIGMATCH_INFO_STICKY_BUFFER
#define SIGMATCH_INFO_STICKY_BUFFER
Definition: detect.h:1497
DetectU32Match
int DetectU32Match(const uint32_t parg, const DetectUintData_u32 *du32)
Definition: detect-engine-uint.c:31
SSLCertsChain_::cert_len
uint32_t cert_len
Definition: app-layer-ssl.h:223
SigTableElmt_::desc
const char * desc
Definition: detect.h:1295
TLS_STATE_CERT_READY
@ TLS_STATE_CERT_READY
Definition: app-layer-ssl.h:78
SigTableElmt_::Free
void(* Free)(DetectEngineCtx *, void *)
Definition: detect.h:1283
flow-util.h
SigTableElmt_::name
const char * name
Definition: detect.h:1293
InspectionBuffer::initialized
bool initialized
Definition: detect.h:375
stream-tcp.h
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1445
DETECT_AL_TLS_CERTS
@ DETECT_AL_TLS_CERTS
Definition: detect-engine-register.h:238
DetectEngineTransforms
Definition: detect.h:406
SSLState_::client_connp
SSLStateConnp client_connp
Definition: app-layer-ssl.h:302
ALPROTO_TLS
@ ALPROTO_TLS
Definition: app-layer-protos.h:33
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:269
DetectU32Parse
DetectUintData_u32 * DetectU32Parse(const char *u32str)
This function is used to parse u32 options passed via some u32 keyword.
Definition: detect-engine-uint.c:45
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:0
SSLState_::server_connp
SSLStateConnp server_connp
Definition: app-layer-ssl.h:303
DetectBufferSetActiveList
int DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
Definition: detect-engine.c:1382
SSLStateConnp_
Definition: app-layer-ssl.h:228
InspectionBuffer
Definition: detect.h:371
KEYWORD_NAME
#define KEYWORD_NAME
Definition: detect-tls-certs.c:261
threads.h
Flow_
Flow data structure.
Definition: flow.h:350
DetectEngineThreadCtx_::pmq
PrefilterRuleStore pmq
Definition: detect.h:1201
SigTableElmt_::flags
uint16_t flags
Definition: detect.h:1287
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:836
TAILQ_EMPTY
#define TAILQ_EMPTY(head)
Definition: queue.h:248
DetectBufferTypeSupportsMultiInstance
void DetectBufferTypeSupportsMultiInstance(const char *name)
Definition: detect-engine.c:1069
TAILQ_FOREACH
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:252
SigTableElmt_::AppLayerTxMatch
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
Definition: detect.h:1264
TlsCertsGetDataArgs
Definition: detect-tls-certs.c:70
DetectBufferMpmRegistry_
one time registration of keywords at start up
Definition: detect.h:677
DetectBufferMpmRegistry_::app_v2
struct DetectBufferMpmRegistry_::@88::@90 app_v2
SIG_FLAG_TOCLIENT
#define SIG_FLAG_TOCLIENT
Definition: detect.h:264
PrefilterMpmTlsCerts
struct PrefilterMpmTlsCerts PrefilterMpmTlsCerts
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1278
detect-pcre.h
DetectBufferMpmRegistry_::transforms
DetectEngineTransforms transforms
Definition: detect.h:690
detect-engine-prefilter.h
util-unittest.h
util-unittest-helper.h
KEYWORD_ID
#define KEYWORD_ID
Definition: detect-tls-certs.c:260
DetectBufferTypeGetByName
int DetectBufferTypeGetByName(const char *name)
Definition: detect-engine.c:1119
DetectEngineAppInspectionEngine_::sm_list
uint16_t sm_list
Definition: detect.h:430
SIG_FLAG_TOSERVER
#define SIG_FLAG_TOSERVER
Definition: detect.h:263
InspectionBufferSetupMultiEmpty
void InspectionBufferSetupMultiEmpty(InspectionBuffer *buffer)
setup the buffer empty
Definition: detect-engine.c:1593
KEYWORD_DESC
#define KEYWORD_DESC
Definition: detect-tls-certs.c:262
TlsCertsGetDataArgs::cert
SSLCertsChain * cert
Definition: detect-tls-certs.c:72
decode.h
util-debug.h
TAILQ_FIRST
#define TAILQ_FIRST(head)
Definition: queue.h:250
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:17
DetectEngineThreadCtx_
Definition: detect.h:1092
SSLCertsChain_
Definition: app-layer-ssl.h:221
util-print.h
SCEnter
#define SCEnter(...)
Definition: util-debug.h:271
detect-engine-mpm.h
detect.h
DETECT_ENGINE_INSPECT_SIG_MATCH
#define DETECT_ENGINE_INSPECT_SIG_MATCH
Definition: detect-engine-state.h:38
InspectionBuffer::inspect_offset
uint64_t inspect_offset
Definition: detect.h:373
DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE
@ DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE
Definition: detect-engine-content-inspection.h:36
BUFFER_NAME
#define BUFFER_NAME
Definition: detect-tls-certs.c:259
DetectAppLayerMpmRegister
void DetectAppLayerMpmRegister(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register a MPM engine
Definition: detect-engine-mpm.c:89
MpmCtx_::minlen
uint16_t minlen
Definition: util-mpm.h:99
util-profiling.h
Packet_
Definition: decode.h:436
SCReturnPtr
#define SCReturnPtr(x, type)
Definition: util-debug.h:287
PrefilterMpmTlsCerts::mpm_ctx
const MpmCtx * mpm_ctx
Definition: detect-tls-certs.c:78
DetectTlsCertsRegister
void DetectTlsCertsRegister(void)
Registration function for keyword: tls.certs.
Definition: detect-tls-certs.c:85
SSLCertsChain_::cert_data
uint8_t * cert_data
Definition: app-layer-ssl.h:222
MpmTableElmt_::Search
uint32_t(* Search)(const struct MpmCtx_ *, struct MpmThreadCtx_ *, PrefilterRuleStore *, const uint8_t *, uint32_t)
Definition: util-mpm.h:168
DetectEngineAppInspectionEngine_::v2
struct DetectEngineAppInspectionEngine_::@85 v2
DetectEngineThreadCtx_::mtc
MpmThreadCtx mtc
Definition: detect.h:1200
detect-engine-content-inspection.h
SigMatchCtx_
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
Definition: detect.h:342
DetectEngineAppInspectionEngine_::smd
SigMatchData * smd
Definition: detect.h:441
detect-tls-certs.c
AppLayerTxData
struct AppLayerTxData AppLayerTxData
Definition: detect.h:1355
cnt
uint32_t cnt
Definition: tmqh-packetpool.h:7
PREFILTER_PROFILING_ADD_BYTES
#define PREFILTER_PROFILING_ADD_BYTES(det_ctx, bytes)
Definition: util-profiling.h:287
DETECT_CI_FLAGS_SINGLE
#define DETECT_CI_FLAGS_SINGLE
Definition: detect-engine-content-inspection.h:49
flags
uint8_t flags
Definition: decode-gre.h:0
suricata-common.h
PrefilterMpmTlsCerts::list_id
int list_id
Definition: detect-tls-certs.c:77
DetectBufferMpmRegistry_::name
const char * name
Definition: detect.h:678
sigmatch_table
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
Definition: detect-parse.c:127
DetectU32Data
DetectUintData_u32 DetectU32Data
Definition: detect-engine-uint.h:41
TAILQ_NEXT
#define TAILQ_NEXT(elm, field)
Definition: queue.h:307
util-spm.h
PrefilterMpmTlsCerts
Definition: detect-tls-certs.c:76
InspectionBufferSetupMulti
void InspectionBufferSetupMulti(InspectionBuffer *buffer, const DetectEngineTransforms *transforms, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
Definition: detect-engine.c:1606
PrefilterAppendTxEngine
int PrefilterAppendTxEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterTxFn PrefilterTxFunc, AppProto alproto, int tx_min_progress, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
Definition: detect-engine-prefilter.c:270
DetectEngineInspectGenericList
uint8_t DetectEngineInspectGenericList(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Do the content inspection & validation for a signature.
Definition: detect-engine.c:2126
DETECT_ENGINE_INSPECT_SIG_NO_MATCH
#define DETECT_ENGINE_INSPECT_SIG_NO_MATCH
Definition: detect-engine-state.h:37
KEYWORD_URL
#define KEYWORD_URL
Definition: detect-tls-certs.c:263
detect-tls-certs.h
InspectionBuffer::inspect_len
uint32_t inspect_len
Definition: detect.h:374
InspectionBuffer::inspect
const uint8_t * inspect
Definition: detect.h:372
str
#define str(s)
Definition: suricata-common.h:291
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:261
SCFree
#define SCFree(p)
Definition: util-mem.h:61
Flow_::alstate
void * alstate
Definition: flow.h:475
detect-parse.h
Signature_
Signature container.
Definition: detect.h:593
DetectEngineAppInspectionEngine_::transforms
const DetectEngineTransforms * transforms
Definition: detect.h:438
PrefilterMpmTlsCerts::transforms
const DetectEngineTransforms * transforms
Definition: detect-tls-certs.c:79
mpm_table
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
Definition: util-mpm.c:47
DetectTlsCertChainLenRegister
void DetectTlsCertChainLenRegister(void)
Definition: detect-tls-certs.c:345
TlsCertsGetDataArgs::local_id
uint32_t local_id
Definition: detect-tls-certs.c:71
InspectionBufferMultipleForListGet
InspectionBuffer * InspectionBufferMultipleForListGet(DetectEngineThreadCtx *det_ctx, const int list_id, const uint32_t local_id)
for a InspectionBufferMultipleForList get a InspectionBuffer
Definition: detect-engine.c:1546
SIGMATCH_NOOPT
#define SIGMATCH_NOOPT
Definition: detect.h:1473
DetectAppLayerInspectEngineRegister
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
register inspect engine at start up time
Definition: detect-engine.c:216
SigMatchAppendSMToList
SigMatch * SigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
Definition: detect-parse.c:447
DetectBufferTypeSetDescriptionByName
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
Definition: detect-engine.c:1216
MpmCtx_
Definition: util-mpm.h:88
flow.h
DetectEngineContentInspection
bool DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Packet *p, Flow *f, const uint8_t *buffer, const uint32_t buffer_len, const uint32_t stream_start_offset, const uint8_t flags, const enum DetectContentInspectionType inspection_mode)
wrapper around DetectEngineContentInspectionInternal to return true/false only
Definition: detect-engine-content-inspection.c:723
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:275
flow-var.h
app-layer-ssl.h
SigTableElmt_::RegisterTests
void(* RegisterTests)(void)
Definition: detect.h:1285
app-layer.h