Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

packet-oscore.h
1 /* packet-oscore.h
2 *
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10 #ifndef __PACKET_OSCORE_H__
11 #define __PACKET_OSCORE_H__
12
13 /* OSCORE uses AEAD algorithms defined in RFC8152 (COSE)
14 * We only implement the default algorithm which corresponds to CCM*
15 * */
16 typedef enum {
17 COSE_AES_CCM_16_64_128 = 10,
18 } cose_aead_alg_t;
19
20 typedef enum {
21 STATUS_ERROR_DECRYPT_FAILED = 0,
22 STATUS_ERROR_CBCMAC_FAILED,
23 STATUS_ERROR_TAG_CHECK_FAILED,
24 STATUS_ERROR_MESSAGE_TOO_SMALL,
25 STATUS_SUCCESS_DECRYPTED_TAG_TRUNCATED,
26 STATUS_SUCCESS_DECRYPTED_TAG_CHECKED,
27 } oscore_decryption_status_t;
28
29 /* Structure containing information regarding all necessary OSCORE message fields. */
30 typedef struct oscore_context {
31 /* Pre-Shared Parameters as Strings */
32 gchar *master_secret_prefs;
33 gchar *master_salt_prefs;
34 gchar *sender_id_prefs;
35 gchar *recipient_id_prefs;
36 cose_aead_alg_t algorithm;
37 /* Pre-Shared Parameters as Byte Arrays */
38 GByteArray *master_secret;
39 GByteArray *master_salt;
40 GByteArray *sender_id;
41 GByteArray *recipient_id;
42 /* Derived Parameters */
43 GByteArray *request_decryption_key;
44 GByteArray *response_decryption_key;
45 GByteArray *common_iv; /* IV used to generate the nonce */
46 } oscore_context_t;
47
48 /* Data from the lower layer (CoAP/HTTP) necessary for OSCORE to decrypt the packet */
49 typedef struct oscore_info {
50 guint8 *kid;
51 guint8 kid_len;
52 guint8 *kid_context;
53 guint8 kid_context_len;
54 guint8 *piv;
55 guint8 piv_len;
56 gboolean piv_in_response;
57 gboolean response;
58 } oscore_info_t;
59
60 #endif /* __PACKET_OSCORE_H__ */
61
62 /*
63 * Editor modelines - https://www.wireshark.org/tools/modelines.html
64 *
65 * Local variables:
66 * c-basic-offset: 4
67 * tab-width: 8
68 * indent-tabs-mode: nil
69 * End:
70 *
71 * vi: set shiftwidth=4 tabstop=8 expandtab:
72 * :indentSize=4:tabSize=8:noTabs=true:
73 */
oscore_context
Definition: packet-oscore.h:30
oscore_info
Definition: packet-oscore.h:49