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  if (p->pcap_cnt > 0) {
221  if (fprintf(fpmeta, "PCAP PKT NUM: %"PRIu64"\n", p->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:523
SSLState_
SSLv[2.0|3.[0|1|2|3]] state structure.
Definition: app-layer-ssl.h:236
len
uint8_t len
Definition: app-layer-dnp3.h:2
SSLCertsChain_::cert_len
uint32_t cert_len
Definition: app-layer-ssl.h:163
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:257
ALPROTO_TLS
@ ALPROTO_TLS
Definition: app-layer-protos.h:39
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
Packet_::pcap_cnt
uint64_t pcap_cnt
Definition: decode.h:626
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:0
SSLState_::server_connp
SSLStateConnp server_connp
Definition: app-layer-ssl.h:258
SSLStateConnp_
Definition: app-layer-ssl.h:172
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:161
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:194
TmEcode
TmEcode
Definition: tm-threads-common.h:80
SSLCertsChain_::cert_data
uint8_t * cert_data
Definition: app-layer-ssl.h:162
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:193
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:143
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:215
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:195
SSLStateConnp_::cert0_fingerprint
char * cert0_fingerprint
Definition: app-layer-ssl.h:200
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:192