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