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 };
74 
75 typedef struct PrefilterMpmTlsCerts {
76  int list_id;
77  const MpmCtx *mpm_ctx;
80 
81 /**
82  * \brief Registration function for keyword: tls.certs
83  */
85 {
87  sigmatch_table[DETECT_AL_TLS_CERTS].desc = "sticky buffer to match the TLS certificate buffer";
88  sigmatch_table[DETECT_AL_TLS_CERTS].url = "/rules/tls-keywords.html#tls-certs";
89  sigmatch_table[DETECT_AL_TLS_CERTS].Setup = DetectTlsCertsSetup;
90 #ifdef UNITTESTS
91  sigmatch_table[DETECT_AL_TLS_CERTS].RegisterTests = DetectTlsCertsRegisterTests;
92 #endif
95 
98  DetectEngineInspectTlsCerts, NULL);
99 
101  PrefilterMpmTlsCertsRegister, NULL, ALPROTO_TLS,
103 
105  TLS_STATE_CERT_READY, DetectEngineInspectTlsCerts, NULL);
106 
107  DetectAppLayerMpmRegister2("tls.certs", SIG_FLAG_TOSERVER, 2, PrefilterMpmTlsCertsRegister,
109 
110  DetectBufferTypeSetDescriptionByName("tls.certs", "TLS certificate");
111 
113 
114  g_tls_certs_buffer_id = DetectBufferTypeGetByName("tls.certs");
115 }
116 
117 /**
118  * \brief This function setup the tls.certs modifier keyword
119  *
120  * \param de_ctx Pointer to the Detect Engine Context
121  * \param s Pointer to the Signature to which the keyword belongs
122  * \param str Should hold an empty string always
123  *
124  * \retval 0 On success
125  * \retval -1 On failure
126  */
127 static int DetectTlsCertsSetup(DetectEngineCtx *de_ctx, Signature *s,
128  const char *str)
129 {
130  if (DetectBufferSetActiveList(de_ctx, s, g_tls_certs_buffer_id) < 0)
131  return -1;
132 
134  return -1;
135 
136  return 0;
137 }
138 
139 static InspectionBuffer *TlsCertsGetData(DetectEngineThreadCtx *det_ctx,
140  const DetectEngineTransforms *transforms, Flow *f,
141  struct TlsCertsGetDataArgs *cbdata, int list_id)
142 {
143  SCEnter();
144 
145  InspectionBuffer *buffer =
146  InspectionBufferMultipleForListGet(det_ctx, list_id, cbdata->local_id);
147  if (buffer == NULL || buffer->initialized)
148  return buffer;
149 
150  const SSLState *ssl_state = (SSLState *)f->alstate;
151  const SSLStateConnp *connp;
152 
153  if (f->flags & STREAM_TOSERVER) {
154  connp = &ssl_state->client_connp;
155  } else {
156  connp = &ssl_state->server_connp;
157  }
158 
159  if (TAILQ_EMPTY(&connp->certs)) {
161  return NULL;
162  }
163 
164  if (cbdata->cert == NULL) {
165  cbdata->cert = TAILQ_FIRST(&connp->certs);
166  } else {
167  cbdata->cert = TAILQ_NEXT(cbdata->cert, next);
168  }
169  if (cbdata->cert == NULL) {
171  return NULL;
172  }
173 
174  InspectionBufferSetupMulti(buffer, transforms, cbdata->cert->cert_data, cbdata->cert->cert_len);
175 
176  SCReturnPtr(buffer, "InspectionBuffer");
177 }
178 
179 static uint8_t DetectEngineInspectTlsCerts(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
180  const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags,
181  void *alstate, void *txv, uint64_t tx_id)
182 {
183  const DetectEngineTransforms *transforms = NULL;
184  if (!engine->mpm) {
185  transforms = engine->v2.transforms;
186  }
187 
188  struct TlsCertsGetDataArgs cbdata = { 0, NULL };
189 
190  while (1)
191  {
192  InspectionBuffer *buffer = TlsCertsGetData(det_ctx, transforms, f,
193  &cbdata, engine->sm_list);
194  if (buffer == NULL || buffer->inspect == NULL)
195  break;
196 
197  det_ctx->buffer_offset = 0;
198  det_ctx->discontinue_matching = 0;
199  det_ctx->inspection_recursion_counter = 0;
200 
201  const int match = DetectEngineContentInspection(de_ctx, det_ctx, s, engine->smd,
202  NULL, f, (uint8_t *)buffer->inspect,
203  buffer->inspect_len,
206  if (match == 1) {
208  }
209 
210  cbdata.local_id++;
211  }
212 
214 }
215 
216 static void PrefilterTxTlsCerts(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
217  Flow *f, void *txv, const uint64_t idx, const AppLayerTxData *_txd, const uint8_t flags)
218 {
219  SCEnter();
220 
221  const PrefilterMpmTlsCerts *ctx = (const PrefilterMpmTlsCerts *)pectx;
222  const MpmCtx *mpm_ctx = ctx->mpm_ctx;
223  const int list_id = ctx->list_id;
224 
225  struct TlsCertsGetDataArgs cbdata = { 0, NULL };
226 
227  while (1)
228  {
229  InspectionBuffer *buffer = TlsCertsGetData(det_ctx, ctx->transforms,
230  f, &cbdata, list_id);
231  if (buffer == NULL)
232  break;
233 
234  if (buffer->inspect_len >= mpm_ctx->minlen) {
235  (void)mpm_table[mpm_ctx->mpm_type].Search(mpm_ctx,
236  &det_ctx->mtcu, &det_ctx->pmq,
237  buffer->inspect, buffer->inspect_len);
238  PREFILTER_PROFILING_ADD_BYTES(det_ctx, buffer->inspect_len);
239  }
240 
241  cbdata.local_id++;
242  }
243 }
244 
245 static void PrefilterMpmTlsCertsFree(void *ptr)
246 {
247  SCFree(ptr);
248 }
249 
250 static int PrefilterMpmTlsCertsRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx,
251  const DetectBufferMpmRegistry *mpm_reg, int list_id)
252 {
253  PrefilterMpmTlsCerts *pectx = SCCalloc(1, sizeof(*pectx));
254  if (pectx == NULL)
255  return -1;
256 
257  pectx->list_id = list_id;
258  pectx->mpm_ctx = mpm_ctx;
259  pectx->transforms = &mpm_reg->transforms;
260 
261  return PrefilterAppendTxEngine(de_ctx, sgh, PrefilterTxTlsCerts,
262  mpm_reg->app_v2.alproto, mpm_reg->app_v2.tx_min_progress,
263  pectx, PrefilterMpmTlsCertsFree, mpm_reg->name);
264 }
265 
266 static int g_tls_cert_buffer_id = 0;
267 #define BUFFER_NAME "tls_validity"
268 #define KEYWORD_ID DETECT_AL_TLS_CHAIN_LEN
269 #define KEYWORD_NAME "tls.cert_chain_len"
270 #define KEYWORD_DESC "match TLS certificate chain length"
271 #define KEYWORD_URL "/rules/tls-keywords.html#tls-cert-chain-len"
272 
273 /**
274  * \internal
275  * \brief Function to match cert chain length in TLS
276  *
277  * \param t Pointer to thread vars.
278  * \param det_ctx Pointer to the pattern matcher thread.
279  * \param f Pointer to the current flow.
280  * \param flags Flags.
281  * \param state App layer state.
282  * \param s Pointer to the Signature.
283  * \param m Pointer to the sigmatch that we will cast into
284  * DetectU64Data.
285  *
286  * \retval 0 no match.
287  * \retval 1 match.
288  */
289 static int DetectTLSCertChainLenMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags,
290  void *state, void *txv, const Signature *s, const SigMatchCtx *ctx)
291 {
292  SCEnter();
293 
294  SSLState *ssl_state = state;
295  if (flags & STREAM_TOCLIENT) {
296  SSLStateConnp *connp = &ssl_state->server_connp;
297  uint32_t cnt = 0;
299  TAILQ_FOREACH (cert, &connp->certs, next) {
300  cnt++;
301  }
302  SCLogDebug("%u certs in chain", cnt);
303 
304  const DetectU32Data *dd = (const DetectU32Data *)ctx;
305  if (DetectU32Match(cnt, dd)) {
306  SCReturnInt(1);
307  }
308  }
309  SCReturnInt(0);
310 }
311 
312 /**
313  * \internal
314  * \brief Function to free memory associated with DetectU64Data.
315  *
316  * \param de_ptr Pointer to DetectU64Data.
317  */
318 static void DetectTLSCertChainLenFree(DetectEngineCtx *de_ctx, void *ptr)
319 {
320  rs_detect_u32_free(ptr);
321 }
322 
323 /**
324  * \brief Function to add the parsed tls cert chain len field into the current signature.
325  *
326  * \param de_ctx Pointer to the Detection Engine Context.
327  * \param s Pointer to the Current Signature.
328  * \param rawstr Pointer to the user provided flags options.
329  * \param type Defines if this is notBefore or notAfter.
330  *
331  * \retval 0 on Success.
332  * \retval -1 on Failure.
333  */
334 static int DetectTLSCertChainLenSetup(DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
335 {
337  return -1;
338 
339  DetectU32Data *dd = DetectU32Parse(rawstr);
340  if (dd == NULL) {
341  SCLogError("Parsing \'%s\' failed for %s", rawstr, sigmatch_table[KEYWORD_ID].name);
342  return -1;
343  }
344 
345  SigMatch *sm = SigMatchAlloc();
346  if (sm == NULL) {
347  rs_detect_u32_free(dd);
348  return -1;
349  }
350  sm->type = KEYWORD_ID;
351  sm->ctx = (void *)dd;
352 
353  SigMatchAppendSMToList(s, sm, g_tls_cert_buffer_id);
354  return 0;
355 }
356 
358 {
362  sigmatch_table[KEYWORD_ID].AppLayerTxMatch = DetectTLSCertChainLenMatch;
363  sigmatch_table[KEYWORD_ID].Setup = DetectTLSCertChainLenSetup;
364  sigmatch_table[KEYWORD_ID].Free = DetectTLSCertChainLenFree;
365 
368 
369  g_tls_cert_buffer_id = DetectBufferTypeGetByName(BUFFER_NAME);
370 }
371 
372 #ifdef UNITTESTS
373 #include "tests/detect-tls-certs.c"
374 #endif
detect-engine-uint.h
DetectEngineAppInspectionEngine_
Definition: detect.h:417
SigTableElmt_::url
const char * url
Definition: detect.h:1287
DetectSignatureSetAppProto
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
Definition: detect-parse.c:1703
SSLState_
SSLv[2.0|3.[0|1|2|3]] state structure.
Definition: app-layer-ssl.h:284
DetectEngineAppInspectionEngine_::mpm
bool mpm
Definition: detect.h:421
detect-content.h
MpmCtx_::mpm_type
uint8_t mpm_type
Definition: util-mpm.h:91
DetectEngineThreadCtx_::buffer_offset
uint32_t buffer_offset
Definition: detect.h:1102
detect-engine.h
DetectAppLayerMpmRegister2
void DetectAppLayerMpmRegister2(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
SIGMATCH_INFO_STICKY_BUFFER
#define SIGMATCH_INFO_STICKY_BUFFER
Definition: detect.h:1490
SigMatchAppendSMToList
void SigMatchAppendSMToList(Signature *s, SigMatch *new, const int list)
Append a SigMatch to the list type.
Definition: detect-parse.c:437
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:1286
TLS_STATE_CERT_READY
@ TLS_STATE_CERT_READY
Definition: app-layer-ssl.h:78
SigTableElmt_::Free
void(* Free)(DetectEngineCtx *, void *)
Definition: detect.h:1274
flow-util.h
SigTableElmt_::name
const char * name
Definition: detect.h:1284
InspectionBuffer::initialized
bool initialized
Definition: detect.h:368
stream-tcp.h
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1438
DETECT_AL_TLS_CERTS
@ DETECT_AL_TLS_CERTS
Definition: detect-engine-register.h:227
DetectEngineTransforms
Definition: detect.h:399
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:1387
SSLStateConnp_
Definition: app-layer-ssl.h:228
InspectionBuffer
Definition: detect.h:364
KEYWORD_NAME
#define KEYWORD_NAME
Definition: detect-tls-certs.c:269
threads.h
Flow_
Flow data structure.
Definition: flow.h:347
DetectEngineThreadCtx_::pmq
PrefilterRuleStore pmq
Definition: detect.h:1181
SigTableElmt_::flags
uint16_t flags
Definition: detect.h:1278
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:826
TAILQ_EMPTY
#define TAILQ_EMPTY(head)
Definition: queue.h:248
DetectBufferTypeSupportsMultiInstance
void DetectBufferTypeSupportsMultiInstance(const char *name)
Definition: detect-engine.c:1074
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:1255
TlsCertsGetDataArgs
Definition: detect-tls-certs.c:70
DetectBufferMpmRegistry_
one time registration of keywords at start up
Definition: detect.h:668
SIG_FLAG_TOCLIENT
#define SIG_FLAG_TOCLIENT
Definition: detect.h:256
PrefilterMpmTlsCerts
struct PrefilterMpmTlsCerts PrefilterMpmTlsCerts
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1269
detect-pcre.h
DetectBufferMpmRegistry_::transforms
DetectEngineTransforms transforms
Definition: detect.h:681
detect-engine-prefilter.h
DetectEngineThreadCtx_::mtcu
MpmThreadCtx mtcu
Definition: detect.h:1179
util-unittest.h
util-unittest-helper.h
KEYWORD_ID
#define KEYWORD_ID
Definition: detect-tls-certs.c:268
DetectBufferTypeGetByName
int DetectBufferTypeGetByName(const char *name)
Definition: detect-engine.c:1124
DetectEngineAppInspectionEngine_::sm_list
uint16_t sm_list
Definition: detect.h:423
SIG_FLAG_TOSERVER
#define SIG_FLAG_TOSERVER
Definition: detect.h:255
InspectionBufferSetupMultiEmpty
void InspectionBufferSetupMultiEmpty(InspectionBuffer *buffer)
setup the buffer empty
Definition: detect-engine.c:1593
KEYWORD_DESC
#define KEYWORD_DESC
Definition: detect-tls-certs.c:270
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:1074
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:39
InspectionBuffer::inspect_offset
uint64_t inspect_offset
Definition: detect.h:366
BUFFER_NAME
#define BUFFER_NAME
Definition: detect-tls-certs.c:267
MpmCtx_::minlen
uint16_t minlen
Definition: util-mpm.h:100
SigMatch_::ctx
SigMatchCtx * ctx
Definition: detect.h:343
util-profiling.h
Packet_
Definition: decode.h:430
DetectAppLayerInspectEngineRegister2
void DetectAppLayerInspectEngineRegister2(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr2 Callback2, InspectionBufferGetDataPtr GetData)
register inspect engine at start up time
Definition: detect-engine.c:216
SCReturnPtr
#define SCReturnPtr(x, type)
Definition: util-debug.h:287
PrefilterMpmTlsCerts::mpm_ctx
const MpmCtx * mpm_ctx
Definition: detect-tls-certs.c:77
DetectTlsCertsRegister
void DetectTlsCertsRegister(void)
Registration function for keyword: tls.certs.
Definition: detect-tls-certs.c:84
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:163
SigMatchAlloc
SigMatch * SigMatchAlloc(void)
Definition: detect-parse.c:322
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:335
DetectEngineThreadCtx_::discontinue_matching
uint16_t discontinue_matching
Definition: detect.h:1139
DetectEngineAppInspectionEngine_::smd
SigMatchData * smd
Definition: detect.h:434
DetectEngineContentInspection
uint8_t DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Packet *p, Flow *f, const uint8_t *buffer, uint32_t buffer_len, uint32_t stream_start_offset, uint8_t flags, uint8_t inspection_mode)
Run the actual payload match functions.
Definition: detect-engine-content-inspection.c:106
detect-tls-certs.c
AppLayerTxData
struct AppLayerTxData AppLayerTxData
Definition: detect.h:1346
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:47
flags
uint8_t flags
Definition: decode-gre.h:0
suricata-common.h
PrefilterMpmTlsCerts::list_id
int list_id
Definition: detect-tls-certs.c:76
SigMatch_::type
uint16_t type
Definition: detect.h:341
DetectBufferMpmRegistry_::app_v2
struct DetectBufferMpmRegistry_::@86::@88 app_v2
DetectBufferMpmRegistry_::name
const char * name
Definition: detect.h:669
sigmatch_table
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
Definition: detect-parse.c:129
DetectEngineThreadCtx_::inspection_recursion_counter
int inspection_recursion_counter
Definition: detect.h:1158
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:75
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:2122
DETECT_ENGINE_INSPECT_SIG_NO_MATCH
#define DETECT_ENGINE_INSPECT_SIG_NO_MATCH
Definition: detect-engine-state.h:38
KEYWORD_URL
#define KEYWORD_URL
Definition: detect-tls-certs.c:271
detect-tls-certs.h
InspectionBuffer::inspect_len
uint32_t inspect_len
Definition: detect.h:367
DetectEngineAppInspectionEngine_::v2
struct DetectEngineAppInspectionEngine_::@83 v2
InspectionBuffer::inspect
const uint8_t * inspect
Definition: detect.h:365
str
#define str(s)
Definition: suricata-common.h:286
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:472
Flow_::flags
uint32_t flags
Definition: flow.h:417
detect-parse.h
Signature_
Signature container.
Definition: detect.h:581
SigMatch_
a single match condition for a signature
Definition: detect.h:340
DetectEngineAppInspectionEngine_::transforms
const DetectEngineTransforms * transforms
Definition: detect.h:431
PrefilterMpmTlsCerts::transforms
const DetectEngineTransforms * transforms
Definition: detect-tls-certs.c:78
mpm_table
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
Definition: util-mpm.c:48
DetectTlsCertChainLenRegister
void DetectTlsCertChainLenRegister(void)
Definition: detect-tls-certs.c:357
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
DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE
@ DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE
Definition: detect-engine-content-inspection.h:36
SIGMATCH_NOOPT
#define SIGMATCH_NOOPT
Definition: detect.h:1466
DetectBufferTypeSetDescriptionByName
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
Definition: detect-engine.c:1221
MpmCtx_
Definition: util-mpm.h:89
flow.h
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:1276
app-layer.h