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,
66  SigGroupHead *sgh, MpmCtx *mpm_ctx,
67  const DetectBufferMpmRegistery *mpm_reg, int list_id);
68 
69 static int g_tls_certs_buffer_id = 0;
70 
72  uint32_t local_id; /**< used as index into thread inspect array */
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 
99  DetectEngineInspectTlsCerts, NULL);
100 
102  PrefilterMpmTlsCertsRegister, NULL, ALPROTO_TLS,
104 
106  TLS_STATE_CERT_READY, DetectEngineInspectTlsCerts, NULL);
107 
108  DetectAppLayerMpmRegister2("tls.certs", SIG_FLAG_TOSERVER, 2, PrefilterMpmTlsCertsRegister,
110 
111  DetectBufferTypeSetDescriptionByName("tls.certs", "TLS certificate");
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(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 (f->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)) {
159  return NULL;
160  }
161 
162  if (cbdata->cert == NULL) {
163  cbdata->cert = TAILQ_FIRST(&connp->certs);
164  } else {
165  cbdata->cert = TAILQ_NEXT(cbdata->cert, next);
166  }
167  if (cbdata->cert == NULL) {
168  return NULL;
169  }
170 
171  InspectionBufferSetupMulti(buffer, transforms, cbdata->cert->cert_data, cbdata->cert->cert_len);
172 
173  SCReturnPtr(buffer, "InspectionBuffer");
174 }
175 
176 static uint8_t DetectEngineInspectTlsCerts(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
177  const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags,
178  void *alstate, void *txv, uint64_t tx_id)
179 {
180  const DetectEngineTransforms *transforms = NULL;
181  if (!engine->mpm) {
182  transforms = engine->v2.transforms;
183  }
184 
185  struct TlsCertsGetDataArgs cbdata = { 0, NULL };
186 
187  while (1)
188  {
189  InspectionBuffer *buffer = TlsCertsGetData(det_ctx, transforms, f,
190  &cbdata, engine->sm_list);
191  if (buffer == NULL || buffer->inspect == NULL)
192  break;
193 
194  det_ctx->buffer_offset = 0;
195  det_ctx->discontinue_matching = 0;
196  det_ctx->inspection_recursion_counter = 0;
197 
198  const int match = DetectEngineContentInspection(de_ctx, det_ctx, s, engine->smd,
199  NULL, f, (uint8_t *)buffer->inspect,
200  buffer->inspect_len,
203  if (match == 1) {
205  }
206 
207  cbdata.local_id++;
208  }
209 
211 }
212 
213 static void PrefilterTxTlsCerts(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
214  Flow *f, void *txv, const uint64_t idx, const AppLayerTxData *_txd, const uint8_t flags)
215 {
216  SCEnter();
217 
218  const PrefilterMpmTlsCerts *ctx = (const PrefilterMpmTlsCerts *)pectx;
219  const MpmCtx *mpm_ctx = ctx->mpm_ctx;
220  const int list_id = ctx->list_id;
221 
222  struct TlsCertsGetDataArgs cbdata = { 0, NULL };
223 
224  while (1)
225  {
226  InspectionBuffer *buffer = TlsCertsGetData(det_ctx, ctx->transforms,
227  f, &cbdata, list_id);
228  if (buffer == NULL)
229  break;
230 
231  if (buffer->inspect_len >= mpm_ctx->minlen) {
232  (void)mpm_table[mpm_ctx->mpm_type].Search(mpm_ctx,
233  &det_ctx->mtcu, &det_ctx->pmq,
234  buffer->inspect, buffer->inspect_len);
235  PREFILTER_PROFILING_ADD_BYTES(det_ctx, buffer->inspect_len);
236  }
237 
238  cbdata.local_id++;
239  }
240 }
241 
242 static void PrefilterMpmTlsCertsFree(void *ptr)
243 {
244  SCFree(ptr);
245 }
246 
247 static int PrefilterMpmTlsCertsRegister(DetectEngineCtx *de_ctx,
248  SigGroupHead *sgh, MpmCtx *mpm_ctx,
249  const DetectBufferMpmRegistery *mpm_reg, int list_id)
250 {
251  PrefilterMpmTlsCerts *pectx = SCCalloc(1, sizeof(*pectx));
252  if (pectx == NULL)
253  return -1;
254 
255  pectx->list_id = list_id;
256  pectx->mpm_ctx = mpm_ctx;
257  pectx->transforms = &mpm_reg->transforms;
258 
259  return PrefilterAppendTxEngine(de_ctx, sgh, PrefilterTxTlsCerts,
260  mpm_reg->app_v2.alproto, mpm_reg->app_v2.tx_min_progress,
261  pectx, PrefilterMpmTlsCertsFree, mpm_reg->name);
262 }
263 
264 static int g_tls_cert_buffer_id = 0;
265 #define BUFFER_NAME "tls_validity"
266 #define KEYWORD_ID DETECT_AL_TLS_CHAIN_LEN
267 #define KEYWORD_NAME "tls.cert_chain_len"
268 #define KEYWORD_DESC "match TLS certificate chain length"
269 #define KEYWORD_URL "/rules/tls-keywords.html#tls-cert-chain-len"
270 
271 /**
272  * \internal
273  * \brief Function to match cert chain length in TLS
274  *
275  * \param t Pointer to thread vars.
276  * \param det_ctx Pointer to the pattern matcher thread.
277  * \param f Pointer to the current flow.
278  * \param flags Flags.
279  * \param state App layer state.
280  * \param s Pointer to the Signature.
281  * \param m Pointer to the sigmatch that we will cast into
282  * DetectU64Data.
283  *
284  * \retval 0 no match.
285  * \retval 1 match.
286  */
287 static int DetectTLSCertChainLenMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags,
288  void *state, void *txv, const Signature *s, const SigMatchCtx *ctx)
289 {
290  SCEnter();
291 
292  SSLState *ssl_state = state;
293  if (flags & STREAM_TOCLIENT) {
294  SSLStateConnp *connp = &ssl_state->server_connp;
295  uint32_t cnt = 0;
297  TAILQ_FOREACH (cert, &connp->certs, next) {
298  cnt++;
299  }
300  SCLogDebug("%u certs in chain", cnt);
301 
302  const DetectU32Data *dd = (const DetectU32Data *)ctx;
303  if (DetectU32Match(cnt, dd)) {
304  SCReturnInt(1);
305  }
306  }
307  SCReturnInt(0);
308 }
309 
310 /**
311  * \internal
312  * \brief Function to free memory associated with DetectU64Data.
313  *
314  * \param de_ptr Pointer to DetectU64Data.
315  */
316 static void DetectTLSCertChainLenFree(DetectEngineCtx *de_ctx, void *ptr)
317 {
318  rs_detect_u32_free(ptr);
319 }
320 
321 /**
322  * \brief Function to add the parsed tls cert chain len field into the current signature.
323  *
324  * \param de_ctx Pointer to the Detection Engine Context.
325  * \param s Pointer to the Current Signature.
326  * \param rawstr Pointer to the user provided flags options.
327  * \param type Defines if this is notBefore or notAfter.
328  *
329  * \retval 0 on Success.
330  * \retval -1 on Failure.
331  */
332 static int DetectTLSCertChainLenSetup(DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
333 {
335  return -1;
336 
337  DetectU32Data *dd = DetectU32Parse(rawstr);
338  if (dd == NULL) {
339  SCLogError("Parsing \'%s\' failed for %s", rawstr, sigmatch_table[KEYWORD_ID].name);
340  return -1;
341  }
342 
343  SigMatch *sm = SigMatchAlloc();
344  if (sm == NULL) {
345  rs_detect_u32_free(dd);
346  return -1;
347  }
348  sm->type = KEYWORD_ID;
349  sm->ctx = (void *)dd;
350 
351  SigMatchAppendSMToList(s, sm, g_tls_cert_buffer_id);
352  return 0;
353 }
354 
356 {
360  sigmatch_table[KEYWORD_ID].AppLayerTxMatch = DetectTLSCertChainLenMatch;
361  sigmatch_table[KEYWORD_ID].Setup = DetectTLSCertChainLenSetup;
362  sigmatch_table[KEYWORD_ID].Free = DetectTLSCertChainLenFree;
363 
366 
367  g_tls_cert_buffer_id = DetectBufferTypeGetByName(BUFFER_NAME);
368 }
369 
370 #ifdef UNITTESTS
371 #include "tests/detect-tls-certs.c"
372 #endif
detect-engine-uint.h
DetectEngineAppInspectionEngine_
Definition: detect.h:390
SigTableElmt_::url
const char * url
Definition: detect.h:1241
DetectSignatureSetAppProto
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
Definition: detect-parse.c:1498
SSLState_
SSLv[2.0|3.[0|1|2|3]] state structure.
Definition: app-layer-ssl.h:288
DetectEngineAppInspectionEngine_::mpm
bool mpm
Definition: detect.h:394
detect-content.h
MpmCtx_::mpm_type
uint8_t mpm_type
Definition: util-mpm.h:90
DetectEngineThreadCtx_::buffer_offset
uint32_t buffer_offset
Definition: detect.h:1053
detect-engine.h
SIGMATCH_INFO_STICKY_BUFFER
#define SIGMATCH_INFO_STICKY_BUFFER
Definition: detect.h:1447
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:226
SigTableElmt_::desc
const char * desc
Definition: detect.h:1240
DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE
@ DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE
Definition: detect-engine-content-inspection.h:36
SigTableElmt_::Free
void(* Free)(DetectEngineCtx *, void *)
Definition: detect.h:1228
flow-util.h
SigTableElmt_::name
const char * name
Definition: detect.h:1238
InspectionBuffer::initialized
bool initialized
Definition: detect.h:341
stream-tcp.h
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1395
DETECT_AL_TLS_CERTS
@ DETECT_AL_TLS_CERTS
Definition: detect-engine-register.h:226
DetectEngineTransforms
Definition: detect.h:372
SSLState_::client_connp
SSLStateConnp client_connp
Definition: app-layer-ssl.h:306
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:307
SSLStateConnp_
Definition: app-layer-ssl.h:231
DetectBufferMpmRegistery_::transforms
DetectEngineTransforms transforms
Definition: detect.h:640
InspectionBuffer
Definition: detect.h:337
KEYWORD_NAME
#define KEYWORD_NAME
Definition: detect-tls-certs.c:267
threads.h
Flow_
Flow data structure.
Definition: flow.h:357
DetectEngineThreadCtx_::pmq
PrefilterRuleStore pmq
Definition: detect.h:1134
SigTableElmt_::flags
uint16_t flags
Definition: detect.h:1232
DetectBufferMpmRegistery_::app_v2
struct DetectBufferMpmRegistery_::@87::@89 app_v2
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:785
TAILQ_EMPTY
#define TAILQ_EMPTY(head)
Definition: queue.h:248
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:1209
TlsCertsGetDataArgs
Definition: detect-tls-certs.c:71
DetectBufferMpmRegistery_
one time registration of keywords at start up
Definition: detect.h:626
TLS_STATE_CERT_READY
@ TLS_STATE_CERT_READY
Definition: app-layer-ssl.h:78
SIG_FLAG_TOCLIENT
#define SIG_FLAG_TOCLIENT
Definition: detect.h:229
PrefilterMpmTlsCerts
struct PrefilterMpmTlsCerts PrefilterMpmTlsCerts
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1223
detect-pcre.h
DetectEngineAppInspectionEngine_::v2
struct DetectEngineAppInspectionEngine_::@84 v2
detect-engine-prefilter.h
DetectEngineThreadCtx_::mtcu
MpmThreadCtx mtcu
Definition: detect.h:1132
util-unittest.h
util-unittest-helper.h
KEYWORD_ID
#define KEYWORD_ID
Definition: detect-tls-certs.c:266
DetectBufferTypeGetByName
int DetectBufferTypeGetByName(const char *name)
Definition: detect-engine.c:1079
DetectEngineAppInspectionEngine_::sm_list
uint16_t sm_list
Definition: detect.h:396
SIG_FLAG_TOSERVER
#define SIG_FLAG_TOSERVER
Definition: detect.h:228
KEYWORD_DESC
#define KEYWORD_DESC
Definition: detect-tls-certs.c:268
TlsCertsGetDataArgs::cert
SSLCertsChain * cert
Definition: detect-tls-certs.c:73
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:1025
SSLCertsChain_
Definition: app-layer-ssl.h:224
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:339
BUFFER_NAME
#define BUFFER_NAME
Definition: detect-tls-certs.c:265
MpmCtx_::minlen
uint16_t minlen
Definition: util-mpm.h:99
SigMatch_::ctx
SigMatchCtx * ctx
Definition: detect.h:316
util-profiling.h
DetectBufferMpmRegistery_::name
const char * name
Definition: detect.h:627
Packet_
Definition: decode.h:428
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:224
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:225
MpmTableElmt_::Search
uint32_t(* Search)(const struct MpmCtx_ *, struct MpmThreadCtx_ *, PrefilterRuleStore *, const uint8_t *, uint32_t)
Definition: util-mpm.h:165
SigMatchAlloc
SigMatch * SigMatchAlloc(void)
Definition: detect-parse.c:239
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:308
DetectEngineThreadCtx_::discontinue_matching
uint16_t discontinue_matching
Definition: detect.h:1092
DetectEngineAppInspectionEngine_::smd
SigMatchData * smd
Definition: detect.h:407
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
DetectAppLayerMpmRegister2
void DetectAppLayerMpmRegister2(const char *name, int direction, int priority, int(*PrefilterRegister)(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id), InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register a MPM engine
Definition: detect-engine-mpm.c:89
AppLayerTxData
struct AppLayerTxData AppLayerTxData
Definition: detect.h:1303
PREFILTER_PROFILING_ADD_BYTES
#define PREFILTER_PROFILING_ADD_BYTES(det_ctx, bytes)
Definition: util-profiling.h:307
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:77
SigMatch_::type
uint16_t type
Definition: detect.h:314
sigmatch_table
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
Definition: detect-parse.c:76
DetectEngineThreadCtx_::inspection_recursion_counter
int inspection_recursion_counter
Definition: detect.h:1111
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:1431
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:1948
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:269
detect-tls-certs.h
InspectionBuffer::inspect_len
uint32_t inspect_len
Definition: detect.h:340
InspectionBuffer::inspect
const uint8_t * inspect
Definition: detect.h:338
str
#define str(s)
Definition: suricata-common.h:280
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:482
Flow_::flags
uint32_t flags
Definition: flow.h:427
detect-parse.h
Signature_
Signature container.
Definition: detect.h:540
SigMatch_
a single match condition for a signature
Definition: detect.h:313
DetectEngineAppInspectionEngine_::transforms
const DetectEngineTransforms * transforms
Definition: detect.h:404
PrefilterMpmTlsCerts::transforms
const DetectEngineTransforms * transforms
Definition: detect-tls-certs.c:79
mpm_table
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
Definition: util-mpm.c:48
DetectTlsCertChainLenRegister
void DetectTlsCertChainLenRegister(void)
Definition: detect-tls-certs.c:355
TlsCertsGetDataArgs::local_id
uint32_t local_id
Definition: detect-tls-certs.c:72
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:1384
SIGMATCH_NOOPT
#define SIGMATCH_NOOPT
Definition: detect.h:1423
DetectBufferSetActiveList
int DetectBufferSetActiveList(Signature *s, const int list)
Definition: detect-engine.c:1293
DetectBufferTypeSetDescriptionByName
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
Definition: detect-engine.c:1176
MpmCtx_
Definition: util-mpm.h:88
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
SigMatchAppendSMToList
void SigMatchAppendSMToList(Signature *s, SigMatch *new, int list)
Append a SigMatch to the list type.
Definition: detect-parse.c:354
SigTableElmt_::RegisterTests
void(* RegisterTests)(void)
Definition: detect.h:1230
app-layer.h