| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
secrets.h
Go to the documentation of this file.
1
11#pragma once
12#include <inttypes.h>
13#include <stdbool.h>
14
15#include <glib.h>
16#include "ws_symbol_export.h"
17#include <wiretap/wtap.h>
18
19#ifdef __cplusplus
20 extern "C" {
21#endif /* __cplusplus */
22
37
41 void secrets_init(void);
42
46 void secrets_cleanup(void);
47
48#if 0
55 enum secrets_scope {
56 SECRETS_SCOPE_EPAN,
57 SECRETS_SCOPE_FILE,
58};
59#endif
60
61#ifdef HAVE_LIBGNUTLS
63 struct cert_key_id {
64 uint8_t key_id[20];
65};
66 typedef struct cert_key_id cert_key_id_t;
67#endif /* HAVE_LIBGNUTLS */
68
69
73WS_DLL_PUBLIC void
74 secrets_wtap_callback(uint32_t secrets_type, const void *secrets, unsigned size);
75
79 typedef void (*secrets_block_callback_t)(const void *secrets, unsigned size);
80
88WS_DLL_PUBLIC void
89 secrets_register_type(uint32_t secrets_type, secrets_block_callback_t cb);
90
91 typedef unsigned (*secret_inject_count_func)(void);
92 typedef bool (*secret_inject_export_func)(wtap* wth);
93 typedef char* (*secret_export_func)(size_t* length);
94
103WS_DLL_PUBLIC void
104 secrets_register_inject_type(const char* name, secret_inject_count_func count_func, secret_inject_export_func inject_func, secret_export_func export_func);
105
109 typedef enum {
110 SECRETS_EXPORT_SUCCESS = 0,
111 SECRETS_INVALID_CAPTURE_FILE,
112 SECRETS_UNKNOWN_PROTOCOL,
113 SECRETS_NO_SECRETS,
114 SECRETS_EXPORT_FAILED,
115} secrets_export_values;
116
123WS_DLL_PUBLIC unsigned
124 secrets_get_count(const char* name);
125
134WS_DLL_PUBLIC secrets_export_values
135 secrets_export_dsb(const char* name, wtap* wth);
136
146WS_DLL_PUBLIC secrets_export_values
147 secrets_export(const char* name, char** secrets, size_t* secrets_len, unsigned* num_secrets);
148
156WS_DLL_PUBLIC void
157 secrets_inject_foreach(GHFunc func, void* param);
158
159
160#ifdef HAVE_LIBGNUTLS
167WS_DLL_PUBLIC GSList *
168secrets_get_available_keys(void);
169
179WS_DLL_PUBLIC bool
180secrets_verify_key(const char *uri, const char *password, bool *need_password, char **error);
181
183WS_DLL_PUBLIC GHashTable*
184privkey_hash_table_new(void);
185
198WS_DLL_PUBLIC int
199secrets_rsa_decrypt(const cert_key_id_t *key_id, const uint8_t *encr, unsigned encr_len, uint8_t **out, unsigned *out_len);
200#endif /* HAVE_LIBGNUTLS */
201
202#ifdef __cplusplus
203}
204#endif /* __cplusplus */
secrets_export_values
secrets_export_values
Return codes for a secrets (e.g., TLS key log) export operation.
Definition secrets.h:109
SECRETS_NO_SECRETS
@ SECRETS_NO_SECRETS
Definition secrets.h:113
SECRETS_UNKNOWN_PROTOCOL
@ SECRETS_UNKNOWN_PROTOCOL
Definition secrets.h:112
SECRETS_EXPORT_FAILED
@ SECRETS_EXPORT_FAILED
Definition secrets.h:114
SECRETS_INVALID_CAPTURE_FILE
@ SECRETS_INVALID_CAPTURE_FILE
Definition secrets.h:111
SECRETS_EXPORT_SUCCESS
@ SECRETS_EXPORT_SUCCESS
Definition secrets.h:110
secrets_wtap_callback
WS_DLL_PUBLIC void secrets_wtap_callback(uint32_t secrets_type, const void *secrets, unsigned size)
Definition secrets.c:184
secrets_block_callback_t
void(* secrets_block_callback_t)(const void *secrets, unsigned size)
Definition secrets.h:79
secrets_init
void secrets_init(void)
Initialize the secrets management system.
Definition secrets.c:81
secrets_register_type
WS_DLL_PUBLIC void secrets_register_type(uint32_t secrets_type, secrets_block_callback_t cb)
Definition secrets.c:109
secrets_inject_foreach
WS_DLL_PUBLIC void secrets_inject_foreach(GHFunc func, void *param)
Definition secrets.c:178
secrets_register_inject_type
WS_DLL_PUBLIC void secrets_register_inject_type(const char *name, secret_inject_count_func count_func, secret_inject_export_func inject_func, secret_export_func export_func)
Definition secrets.c:115
secrets_export_dsb
WS_DLL_PUBLIC secrets_export_values secrets_export_dsb(const char *name, wtap *wth)
Definition secrets.c:137
secrets_export
WS_DLL_PUBLIC secrets_export_values secrets_export(const char *name, char **secrets, size_t *secrets_len, unsigned *num_secrets)
Definition secrets.c:156
secrets_get_count
WS_DLL_PUBLIC unsigned secrets_get_count(const char *name)
Definition secrets.c:127
secrets_cleanup
void secrets_cleanup(void)
Cleans up all secrets-related resources.
Definition secrets.c:92
wtap
Definition wtap_module.h:58
wtap.h