aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/secrets-types.c
blob: caae63271724697701a84fec6a69f531dbf57a74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* wtap_opttypes.c
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 2001 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */
#include "config.h"

#include "secrets-types.h"

const char* secrets_type_description(uint32_t type)
{
#if 0
    /* value_string from file-pcapng.c
     * XXX: value_string is defined in epan. Perhaps some of the
     * functions (not the ones that allocate in wmem_packet_scope())
     * should be moved to wsutil so that other libraries can use them
     * (capinfos, etc. don't link with libwireshark).
     */
    static const value_string secrets_types_vals[] = {
        { SECRETS_TYPE_TLS,             "TLS Key Log" },
        { SECRETS_TYPE_SSH,             "SSH Key Log" },
        { SECRETS_TYPE_WIREGUARD,       "WireGuard Key Log" },
        { SECRETS_TYPE_ZIGBEE_NWK_KEY,  "Zigbee NWK Key" },
        { SECRETS_TYPE_ZIGBEE_APS_KEY,  "Zigbee APS Key" },
        { SECRETS_TYPE_OPCUA,           "OPC UA Key Log" },
        { 0, NULL }
    };
    return val_to_str_const(type, secrets_types_vals, "Unknown");
#endif
    switch (type) {
        case SECRETS_TYPE_TLS:
            return "TLS Key Log";
        case SECRETS_TYPE_SSH:
            return "SSH Key Log";
        case SECRETS_TYPE_WIREGUARD:
            return "WireGuard Key Log";
        case SECRETS_TYPE_ZIGBEE_NWK_KEY:
            return "Zigbee NWK Key";
        case SECRETS_TYPE_ZIGBEE_APS_KEY:
            return "Zigbee APS Key";
        case SECRETS_TYPE_OPCUA:
            return "OPC UA Key Log";
        default:
            return "Unknown";
    }
}