| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
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 char *master_secret_prefs;
33 char *master_salt_prefs;
34 char *id_context_prefs;
35 char *sender_id_prefs;
36 char *recipient_id_prefs;
37 cose_aead_alg_t algorithm;
38 /* Pre-Shared Parameters as Byte Arrays */
39 GByteArray *master_secret;
40 GByteArray *master_salt;
41 GByteArray *id_context;
42 GByteArray *sender_id;
43 GByteArray *recipient_id;
44 /* Derived Parameters */
45 GByteArray *request_decryption_key;
46 GByteArray *response_decryption_key;
47 GByteArray *common_iv; /* IV used to generate the nonce */
48} oscore_context_t;
49
50/* Data from the lower layer (CoAP/HTTP) necessary for OSCORE to decrypt the packet */
51 typedef struct oscore_info {
52 uint8_t *kid;
53 uint8_t kid_len;
54 uint8_t *kid_context;
55 uint8_t kid_context_len;
56 uint8_t *piv;
57 uint8_t piv_len;
58 uint8_t *request_piv;
59 uint8_t request_piv_len;
60 bool response;
61} oscore_info_t;
62
63#endif /* __PACKET_OSCORE_H__ */
64
65/*
66 * Editor modelines - https://www.wireshark.org/tools/modelines.html
67 *
68 * Local variables:
69 * c-basic-offset: 4
70 * tab-width: 8
71 * indent-tabs-mode: nil
72 * End:
73 *
74 * vi: set shiftwidth=4 tabstop=8 expandtab:
75 * :indentSize=4:tabSize=8:noTabs=true:
76 */
oscore_context
Definition packet-oscore.h:30
oscore_info
Definition packet-oscore.h:51