3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #ifndef __PACKET_OSCORE_H__
11 #define __PACKET_OSCORE_H__
13 /* OSCORE uses AEAD algorithms defined in RFC8152 (COSE)
14 * We only implement the default algorithm which corresponds to CCM*
17 COSE_AES_CCM_16_64_128
= 10,
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
;
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 */
50 /* Data from the lower layer (CoAP/HTTP) necessary for OSCORE to decrypt the packet */
51 typedef struct oscore_info
{
55 uint8_t kid_context_len
;
59 uint8_t request_piv_len
;
63 #endif /* __PACKET_OSCORE_H__ */
66 * Editor modelines - https://www.wireshark.org/tools/modelines.html
71 * indent-tabs-mode: nil
74 * vi: set shiftwidth=4 tabstop=8 expandtab:
75 * :indentSize=4:tabSize=8:noTabs=true: