suricata
log-tlsstore.c
Go to the documentation of this file.
1 /* Copyright (C) 2014-2025 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 Roliers Jean-Paul <popof.fpn@gmail.co>
22  * \author Eric Leblond <eric@regit.org>
23  * \author Victor Julien <victor@inliniac.net>
24  *
25  * Implements TLS store portion of the engine.
26  *
27  */
28 
29 #include "suricata-common.h"
30 #include "log-tlsstore.h"
31 
32 #include "decode.h"
33 
34 #include "app-layer-parser.h"
35 #include "app-layer-ssl.h"
36 
37 #include "output.h"
38 
39 #include "util-conf.h"
40 #include "util-path.h"
41 #include "util-time.h"
42 #include "util-print.h"
43 
44 #define MODULE_NAME "LogTlsStoreLog"
45 
46 static char tls_logfile_base_dir[PATH_MAX] = "/tmp";
47 SC_ATOMIC_DECLARE(unsigned int, cert_id);
48 static char logging_dir_not_writable;
49 
50 #define LOGGING_WRITE_ISSUE_LIMIT 6
51 
52 typedef struct LogTlsStoreLogThread_ {
53  uint8_t* enc_buf;
54  size_t enc_buf_len;
56 
57 static int CreateFileName(
58  const Packet *p, SSLState *state, char *filename, size_t filename_size, const bool client)
59 {
60  char file[PATH_MAX];
61  int file_id = SC_ATOMIC_ADD(cert_id, 1);
62  const char *direction = client ? "client-" : "";
63 
64  /* Use format : packet time + incremental ID
65  * When running on same pcap it will overwrite
66  * On a live device, we will not be able to overwrite */
67  if (snprintf(file, sizeof(file), "%s%ld.%ld-%d.pem", direction, (long int)SCTIME_SECS(p->ts),
68  (long int)SCTIME_USECS(p->ts), file_id) == sizeof(file))
69  return 0;
70 
71  if (PathMerge(filename, filename_size, tls_logfile_base_dir, file) < 0)
72  return 0;
73  return 1;
74 }
75 
76 static int TLSGetIPInformations(const Packet *p, char *srcip, socklen_t srcip_len, Port *sp,
77  char *dstip, socklen_t dstip_len, Port *dp, int ipproto)
78 {
79  if ((PKT_IS_TOSERVER(p))) {
80  switch (ipproto) {
81  case AF_INET:
82  PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, srcip_len);
83  PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, dstip_len);
84  break;
85  case AF_INET6:
86  PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, srcip_len);
87  PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, dstip_len);
88  break;
89  default:
90  return 0;
91  }
92  *sp = p->sp;
93  *dp = p->dp;
94  } else {
95  switch (ipproto) {
96  case AF_INET:
97  PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), srcip, srcip_len);
98  PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), dstip, dstip_len);
99  break;
100  case AF_INET6:
101  PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), srcip, srcip_len);
102  PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), dstip, dstip_len);
103  break;
104  default:
105  return 0;
106  }
107  *sp = p->dp;
108  *dp = p->sp;
109  }
110  return 1;
111 }
112 
113 static inline char *CreateStringFromByteArray(uint8_t *arr, uint32_t len)
114 {
115  uint32_t str_len = len + 1;
116  char *final = SCCalloc(str_len, sizeof(char));
117  if (final == NULL) {
118  return NULL;
119  }
120  memcpy(final, arr, len);
121  final[str_len - 1] = '\0';
122 
123  return final;
124 }
125 
126 static void LogTlsLogPem(LogTlsStoreLogThread *aft, const Packet *p, SSLState *state,
127  SSLStateConnp *connp, int ipproto)
128 {
129 #define PEMHEADER "-----BEGIN CERTIFICATE-----\n"
130 #define PEMFOOTER "-----END CERTIFICATE-----\n"
131  //Logging pem certificate
132  char filename[PATH_MAX] = "";
133  FILE* fp = NULL;
134  FILE* fpmeta = NULL;
135  unsigned long pemlen;
136  unsigned char* pembase64ptr = NULL;
137  int ret;
138  uint8_t *ptmp;
139  SSLCertsChain *cert;
140 
141  if (TAILQ_EMPTY(&connp->certs)) {
142  SCReturn;
143  }
144 
145  const bool client = connp == &state->client_connp;
146  CreateFileName(p, state, filename, sizeof(filename), client);
147  if (strlen(filename) == 0) {
148  SCLogWarning("Can't create PEM filename");
149  SCReturn;
150  }
151 
152  fp = fopen(filename, "w");
153  if (fp == NULL) {
154  if (logging_dir_not_writable < LOGGING_WRITE_ISSUE_LIMIT) {
155  SCLogWarning(
156  "Can't create PEM file '%s' in '%s' directory", filename, tls_logfile_base_dir);
157  logging_dir_not_writable++;
158  }
159  SCReturn;
160  }
161 
162  TAILQ_FOREACH (cert, &connp->certs, next) {
163  pemlen = SCBase64EncodeBufferSize(cert->cert_len);
164  if (pemlen > aft->enc_buf_len) {
165  ptmp = (uint8_t*) SCRealloc(aft->enc_buf, sizeof(uint8_t) * pemlen);
166  if (ptmp == NULL) {
167  SCFree(aft->enc_buf);
168  aft->enc_buf = NULL;
169  aft->enc_buf_len = 0;
170  SCLogWarning("Can't allocate data for base64 encoding");
171  goto end_fp;
172  }
173  aft->enc_buf = ptmp;
174  aft->enc_buf_len = pemlen;
175  }
176 
177  memset(aft->enc_buf, 0, aft->enc_buf_len);
178 
179  ret = SCBase64Encode(
180  (unsigned char *)cert->cert_data, cert->cert_len, aft->enc_buf, &pemlen);
181  if (ret != SC_BASE64_OK) {
182  SCLogWarning("Invalid return of SCBase64Encode function");
183  goto end_fwrite_fp;
184  }
185 
186  if (fprintf(fp, PEMHEADER) < 0)
187  goto end_fwrite_fp;
188 
189  pembase64ptr = aft->enc_buf;
190  while (pemlen > 0) {
191  size_t loffset = pemlen >= 64 ? 64 : pemlen;
192  if (fwrite(pembase64ptr, 1, loffset, fp) != loffset)
193  goto end_fwrite_fp;
194  if (fwrite("\n", 1, 1, fp) != 1)
195  goto end_fwrite_fp;
196  pembase64ptr += 64;
197  if (pemlen < 64)
198  break;
199  pemlen -= 64;
200  }
201 
202  if (fprintf(fp, PEMFOOTER) < 0)
203  goto end_fwrite_fp;
204  }
205  fclose(fp);
206 
207  //Logging certificate informations
208  memcpy(filename + (strlen(filename) - 3), "meta", 4);
209  fpmeta = fopen(filename, "w");
210  if (fpmeta != NULL) {
211  #define PRINT_BUF_LEN 46
212  char srcip[PRINT_BUF_LEN], dstip[PRINT_BUF_LEN];
213  char timebuf[64];
214  Port sp, dp;
215  CreateTimeString(p->ts, timebuf, sizeof(timebuf));
216  if (!TLSGetIPInformations(p, srcip, PRINT_BUF_LEN, &sp, dstip, PRINT_BUF_LEN, &dp, ipproto))
217  goto end_fwrite_fpmeta;
218  if (fprintf(fpmeta, "TIME: %s\n", timebuf) < 0)
219  goto end_fwrite_fpmeta;
220  uint64_t pcap_cnt = PcapPacketCntGet(p);
221  if (pcap_cnt > 0) {
222  if (fprintf(fpmeta, "PCAP PKT NUM: %" PRIu64 "\n", pcap_cnt) < 0)
223  goto end_fwrite_fpmeta;
224  }
225  if (fprintf(fpmeta, "SRC IP: %s\n", srcip) < 0)
226  goto end_fwrite_fpmeta;
227  if (fprintf(fpmeta, "DST IP: %s\n", dstip) < 0)
228  goto end_fwrite_fpmeta;
229  if (fprintf(fpmeta, "PROTO: %" PRIu32 "\n", p->proto) < 0)
230  goto end_fwrite_fpmeta;
231  if (PacketIsTCP(p) || PacketIsUDP(p)) {
232  if (fprintf(fpmeta, "SRC PORT: %" PRIu16 "\n", sp) < 0)
233  goto end_fwrite_fpmeta;
234  if (fprintf(fpmeta, "DST PORT: %" PRIu16 "\n", dp) < 0)
235  goto end_fwrite_fpmeta;
236  }
237 
238  char *subject = CreateStringFromByteArray(connp->cert0_subject, connp->cert0_subject_len);
239  char *issuerdn =
240  CreateStringFromByteArray(connp->cert0_issuerdn, connp->cert0_issuerdn_len);
241  int r = fprintf(fpmeta,
242  "TLS SUBJECT: %s\n"
243  "TLS ISSUERDN: %s\n"
244  "TLS FINGERPRINT: %s\n",
245  subject ? subject : "<ERROR>", issuerdn ? issuerdn : "<ERROR>",
246  connp->cert0_fingerprint);
247  SCFree(subject);
248  SCFree(issuerdn);
249  if (r < 0)
250  goto end_fwrite_fpmeta;
251 
252  fclose(fpmeta);
253  } else {
254  if (logging_dir_not_writable < LOGGING_WRITE_ISSUE_LIMIT) {
255  SCLogWarning("Can't create meta file '%s' in '%s' directory", filename,
256  tls_logfile_base_dir);
257  logging_dir_not_writable++;
258  }
259  SCReturn;
260  }
261 
262  /* Reset the store flag */
263  connp->cert_log_flag &= ~SSL_TLS_LOG_PEM;
264  SCReturn;
265 
266 end_fwrite_fp:
267  fclose(fp);
268  if (logging_dir_not_writable < LOGGING_WRITE_ISSUE_LIMIT) {
269  SCLogWarning("Unable to write certificate");
270  logging_dir_not_writable++;
271  }
272 end_fwrite_fpmeta:
273  if (fpmeta) {
274  fclose(fpmeta);
275  if (logging_dir_not_writable < LOGGING_WRITE_ISSUE_LIMIT) {
276  SCLogWarning("Unable to write certificate metafile");
277  logging_dir_not_writable++;
278  }
279  }
280  SCReturn;
281 end_fp:
282  fclose(fp);
283  SCReturn;
284 }
285 
286 /** \internal
287  * \brief Condition function for TLS logger
288  * \retval bool true or false -- log now?
289  */
290 static bool LogTlsStoreCondition(
291  ThreadVars *tv, const Packet *p, void *state, void *tx, uint64_t tx_id)
292 {
293  if (p->flow == NULL) {
294  return false;
295  }
296 
297  if (!(PacketIsTCP(p))) {
298  return false;
299  }
300 
301  SSLState *ssl_state = (SSLState *)state;
302  if (ssl_state == NULL) {
303  SCLogDebug("no tls state, so no request logging");
304  goto dontlog;
305  }
306 
307  if ((ssl_state->server_connp.cert_log_flag & SSL_TLS_LOG_PEM) == 0) {
308  goto dontlog;
309  }
310 
311  if (ssl_state->server_connp.cert0_issuerdn == NULL ||
312  ssl_state->server_connp.cert0_subject == NULL) {
313  goto dontlog;
314  }
315 
316  return true;
317 dontlog:
318  return false;
319 }
320 
321 static bool LogTlsStoreConditionClient(
322  ThreadVars *tv, const Packet *p, void *state, void *tx, uint64_t tx_id)
323 {
324  if (p->flow == NULL) {
325  return false;
326  }
327 
328  if (!(PacketIsTCP(p))) {
329  return false;
330  }
331 
332  SSLState *ssl_state = (SSLState *)state;
333  if (ssl_state == NULL) {
334  SCLogDebug("no tls state, so no request logging");
335  goto dontlog;
336  }
337 
338  if ((ssl_state->client_connp.cert_log_flag & SSL_TLS_LOG_PEM) == 0) {
339  goto dontlog;
340  }
341 
342  if ((ssl_state->client_connp.cert0_issuerdn == NULL ||
343  ssl_state->client_connp.cert0_subject == NULL)) {
344  goto dontlog;
345  }
346 
347  return true;
348 dontlog:
349  return false;
350 }
351 
352 static int LogTlsStoreLoggerClient(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
353  void *state, void *tx, uint64_t tx_id)
354 {
355  LogTlsStoreLogThread *aft = (LogTlsStoreLogThread *)thread_data;
356  int ipproto = (PacketIsIPv4(p)) ? AF_INET : AF_INET6;
357 
358  SSLState *ssl_state = (SSLState *)state;
359  if (unlikely(ssl_state == NULL)) {
360  return 0;
361  }
362  /* client cert */
363  SSLStateConnp *connp = &ssl_state->client_connp;
364  if (connp->cert_log_flag & SSL_TLS_LOG_PEM) {
365  LogTlsLogPem(aft, p, ssl_state, connp, ipproto);
366  }
367 
368  return 0;
369 }
370 
371 static int LogTlsStoreLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
372  void *state, void *tx, uint64_t tx_id)
373 {
374  LogTlsStoreLogThread *aft = (LogTlsStoreLogThread *)thread_data;
375  int ipproto = (PacketIsIPv4(p)) ? AF_INET : AF_INET6;
376 
377  SSLState *ssl_state = (SSLState *)state;
378  if (unlikely(ssl_state == NULL)) {
379  return 0;
380  }
381  /* server cert */
382  SSLStateConnp *connp = &ssl_state->server_connp;
383  if (connp->cert_log_flag & SSL_TLS_LOG_PEM) {
384  LogTlsLogPem(aft, p, ssl_state, connp, ipproto);
385  }
386 
387  return 0;
388 }
389 
390 static TmEcode LogTlsStoreLogThreadInit(ThreadVars *t, const void *initdata, void **data)
391 {
393  if (unlikely(aft == NULL))
394  return TM_ECODE_FAILED;
395 
396  if (initdata == NULL) {
397  SCLogDebug("Error getting context for LogTLSStore. \"initdata\" argument NULL");
398  SCFree(aft);
399  return TM_ECODE_FAILED;
400  }
401 
402  struct stat stat_buf;
403  /* coverity[toctou] */
404  if (stat(tls_logfile_base_dir, &stat_buf) != 0) {
405  int ret;
406  /* coverity[toctou] */
407  ret = SCMkDir(tls_logfile_base_dir, S_IRWXU|S_IXGRP|S_IRGRP);
408  if (ret != 0) {
409  int err = errno;
410  if (err != EEXIST) {
411  SCLogError("Cannot create certs drop directory %s: %s", tls_logfile_base_dir,
412  strerror(err));
413  exit(EXIT_FAILURE);
414  }
415  } else {
416  SCLogInfo("Created certs drop directory %s",
417  tls_logfile_base_dir);
418  }
419 
420  }
421 
422  *data = (void *)aft;
423  return TM_ECODE_OK;
424 }
425 
426 static TmEcode LogTlsStoreLogThreadDeinit(ThreadVars *t, void *data)
427 {
429  if (aft == NULL) {
430  return TM_ECODE_OK;
431  }
432 
433  if (aft->enc_buf != NULL)
434  SCFree(aft->enc_buf);
435 
436  /* clear memory */
437  memset(aft, 0, sizeof(LogTlsStoreLogThread));
438 
439  SCFree(aft);
440  return TM_ECODE_OK;
441 }
442 
443 /**
444  * \internal
445  *
446  * \brief deinit the log ctx and write out the waldo
447  *
448  * \param output_ctx output context to deinit
449  */
450 static void LogTlsStoreLogDeInitCtx(OutputCtx *output_ctx)
451 {
452  SCFree(output_ctx);
453 }
454 
455 /** \brief Create a new http log LogFilestoreCtx.
456  * \param conf Pointer to ConfNode containing this loggers configuration.
457  * \return NULL if failure, LogFilestoreCtx* to the file_ctx if succesful
458  * */
459 static OutputInitResult LogTlsStoreLogInitCtx(SCConfNode *conf)
460 {
461  OutputInitResult result = { NULL, false };
462  OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx));
463  if (unlikely(output_ctx == NULL))
464  return result;
465 
466  output_ctx->data = NULL;
467  output_ctx->DeInit = LogTlsStoreLogDeInitCtx;
468 
469  const char *s_default_log_dir = SCConfigGetLogDirectory();
470  const char *s_base_dir = SCConfNodeLookupChildValue(conf, "certs-log-dir");
471  if (s_base_dir == NULL || strlen(s_base_dir) == 0) {
472  strlcpy(tls_logfile_base_dir,
473  s_default_log_dir, sizeof(tls_logfile_base_dir));
474  } else {
475  if (PathIsAbsolute(s_base_dir)) {
476  strlcpy(tls_logfile_base_dir,
477  s_base_dir, sizeof(tls_logfile_base_dir));
478  } else {
479  if (PathMerge(tls_logfile_base_dir, sizeof(tls_logfile_base_dir), s_default_log_dir,
480  s_base_dir) < 0) {
481  LogTlsStoreLogDeInitCtx(output_ctx);
482  return result;
483  }
484  }
485  }
486 
487  SCLogInfo("storing certs in %s", tls_logfile_base_dir);
488 
489  /* enable the logger for the app layer */
491 
492  result.ctx = output_ctx;
493  result.ok = true;
494  SCReturnCT(result, "OutputInitResult");
495 }
496 
498 {
500  LogTlsStoreLogInitCtx, ALPROTO_TLS, LogTlsStoreLogger, LogTlsStoreCondition,
501  LogTlsStoreLogThreadInit, LogTlsStoreLogThreadDeinit);
502 
504  LogTlsStoreLogInitCtx, ALPROTO_TLS, LogTlsStoreLoggerClient, LogTlsStoreConditionClient,
505  LogTlsStoreLogThreadInit, LogTlsStoreLogThreadDeinit);
506 
507  SC_ATOMIC_INIT(cert_id);
508  SC_ATOMIC_SET(cert_id, 1);
509 
510  SCLogDebug("registered");
511 }
LogTlsStoreRegister
void LogTlsStoreRegister(void)
Definition: log-tlsstore.c:497
Packet_::proto
uint8_t proto
Definition: decode.h:523
SSLState_
SSLv[2.0|3.[0|1|2|3]] state structure.
Definition: app-layer-ssl.h:237
len
uint8_t len
Definition: app-layer-dnp3.h:2
SSLCertsChain_::cert_len
uint32_t cert_len
Definition: app-layer-ssl.h:164
SC_ATOMIC_INIT
#define SC_ATOMIC_INIT(name)
wrapper for initializing an atomic variable.
Definition: util-atomic.h:314
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
SC_ATOMIC_SET
#define SC_ATOMIC_SET(name, val)
Set the value for the atomic variable.
Definition: util-atomic.h:386
SSLState_::client_connp
SSLStateConnp client_connp
Definition: app-layer-ssl.h:258
ALPROTO_TLS
@ ALPROTO_TLS
Definition: app-layer-protos.h:39
PcapPacketCntGet
uint64_t PcapPacketCntGet(const Packet *p)
Definition: decode.c:1104
PathMerge
int PathMerge(char *out_buf, size_t buf_size, const char *const dir, const char *const fname)
Definition: util-path.c:74
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:282
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:0
SSLState_::server_connp
SSLStateConnp server_connp
Definition: app-layer-ssl.h:259
SSLStateConnp_
Definition: app-layer-ssl.h:173
Flow_
Flow data structure.
Definition: flow.h:347
SC_ATOMIC_ADD
#define SC_ATOMIC_ADD(name, val)
add a value to our atomic variable
Definition: util-atomic.h:332
TAILQ_EMPTY
#define TAILQ_EMPTY(head)
Definition: queue.h:248
TAILQ_FOREACH
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:252
SCConfNodeLookupChildValue
const char * SCConfNodeLookupChildValue(const SCConfNode *node, const char *name)
Lookup the value of a child configuration node by name.
Definition: conf.c:855
TM_ECODE_FAILED
@ TM_ECODE_FAILED
Definition: tm-threads-common.h:82
GET_IPV6_DST_ADDR
#define GET_IPV6_DST_ADDR(p)
Definition: decode.h:204
LogTlsStoreLogThread_
Definition: log-tlsstore.c:52
OutputCtx_::data
void * data
Definition: tm-modules.h:91
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:81
OutputCtx_
Definition: tm-modules.h:88
strlcpy
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition: util-strlcpyu.c:43
OutputRegisterTxModuleWithCondition
void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a tx output module with condition.
Definition: output.c:348
decode.h
GET_IPV4_DST_ADDR_PTR
#define GET_IPV4_DST_ADDR_PTR(p)
Definition: decode.h:199
PKT_IS_TOSERVER
#define PKT_IS_TOSERVER(p)
Definition: decode.h:238
OutputInitResult_::ctx
OutputCtx * ctx
Definition: output.h:47
SCAppLayerParserRegisterLogger
void SCAppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
Definition: app-layer-parser.c:477
Packet_::ts
SCTime_t ts
Definition: decode.h:555
SSLCertsChain_
Definition: app-layer-ssl.h:162
util-print.h
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
PrintInet
const char * PrintInet(int af, const void *src, char *dst, socklen_t size)
Definition: util-print.c:231
Packet_::sp
Port sp
Definition: decode.h:508
LogTlsStoreLogThread
struct LogTlsStoreLogThread_ LogTlsStoreLogThread
util-time.h
OutputInitResult_::ok
bool ok
Definition: output.h:48
SCLogWarning
#define SCLogWarning(...)
Macro used to log WARNING messages.
Definition: util-debug.h:262
app-layer-parser.h
LogTlsStoreLogThread_::enc_buf_len
size_t enc_buf_len
Definition: log-tlsstore.c:54
SCReturn
#define SCReturn
Definition: util-debug.h:286
Packet_
Definition: decode.h:501
SCConfigGetLogDirectory
const char * SCConfigGetLogDirectory(void)
Definition: util-conf.c:38
Port
uint16_t Port
Definition: decode.h:218
SSLStateConnp_::cert0_issuerdn
uint8_t * cert0_issuerdn
Definition: app-layer-ssl.h:195
TmEcode
TmEcode
Definition: tm-threads-common.h:80
SSLCertsChain_::cert_data
uint8_t * cert_data
Definition: app-layer-ssl.h:163
SCLogInfo
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
Definition: util-debug.h:232
SCRealloc
#define SCRealloc(ptr, sz)
Definition: util-mem.h:50
OutputInitResult_
Definition: output.h:46
util-conf.h
Packet_::flow
struct Flow_ * flow
Definition: decode.h:546
SSLStateConnp_::cert0_subject_len
uint32_t cert0_subject_len
Definition: app-layer-ssl.h:194
GET_IPV4_SRC_ADDR_PTR
#define GET_IPV4_SRC_ADDR_PTR(p)
Definition: decode.h:198
suricata-common.h
OutputCtx_::DeInit
void(* DeInit)(struct OutputCtx_ *)
Definition: tm-modules.h:94
PEMFOOTER
#define PEMFOOTER
util-path.h
SCTIME_SECS
#define SCTIME_SECS(t)
Definition: util-time.h:57
PathIsAbsolute
int PathIsAbsolute(const char *path)
Check if a path is absolute.
Definition: util-path.c:44
PRINT_BUF_LEN
#define PRINT_BUF_LEN
SCMkDir
#define SCMkDir(a, b)
Definition: util-path.h:45
MODULE_NAME
#define MODULE_NAME
Definition: log-tlsstore.c:44
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:33
SSL_TLS_LOG_PEM
#define SSL_TLS_LOG_PEM
Definition: app-layer-ssl.h:144
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:274
GET_IPV6_SRC_ADDR
#define GET_IPV6_SRC_ADDR(p)
Definition: decode.h:203
SCFree
#define SCFree(p)
Definition: util-mem.h:61
SSLStateConnp_::cert_log_flag
uint32_t cert_log_flag
Definition: app-layer-ssl.h:216
LOGGER_TLS_STORE_CLIENT
@ LOGGER_TLS_STORE_CLIENT
Definition: suricata-common.h:483
SCReturnCT
#define SCReturnCT(x, type)
Definition: util-debug.h:298
LOGGING_WRITE_ISSUE_LIMIT
#define LOGGING_WRITE_ISSUE_LIMIT
Definition: log-tlsstore.c:50
LogTlsStoreLogThread_::enc_buf
uint8_t * enc_buf
Definition: log-tlsstore.c:53
LOGGER_TLS_STORE
@ LOGGER_TLS_STORE
Definition: suricata-common.h:482
SSLStateConnp_::cert0_issuerdn_len
uint32_t cert0_issuerdn_len
Definition: app-layer-ssl.h:196
SSLStateConnp_::cert0_fingerprint
char * cert0_fingerprint
Definition: app-layer-ssl.h:201
SC_ATOMIC_DECLARE
SC_ATOMIC_DECLARE(unsigned int, cert_id)
log-tlsstore.h
Packet_::dp
Port dp
Definition: decode.h:516
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
SCConfNode_
Definition: conf.h:37
app-layer-ssl.h
PEMHEADER
#define PEMHEADER
CreateTimeString
void CreateTimeString(const SCTime_t ts, char *str, size_t size)
Definition: util-time.c:272
output.h
SCTIME_USECS
#define SCTIME_USECS(t)
Definition: util-time.h:56
SSLStateConnp_::cert0_subject
uint8_t * cert0_subject
Definition: app-layer-ssl.h:193