Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
packet-edhoc.h
1/* packet-cose.h
2 * Definitions for Ephemeral Diffie-Hellman Over COSE (EDHOC) dissection
3 * References:
4 * RFC 9528: https://tools.ietf.org/html/rfc9528
5 *
6 * Copyright 2024-2025, Brian Sipos <brian.sipos@gmail.com>
7 *
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
11 *
12 * SPDX-License-Identifier: LGPL-2.1-or-later
13 */
14#ifndef __PACKET_EDHOC_H__
15#define __PACKET_EDHOC_H__
16
17#include "packet-cose.h"
18#include <epan/conversation.h>
19#include <glib.h>
20#include <stdint.h>
21#include <stdbool.h>
22
56
61typedef struct {
65 uint64_t sess_idx;
66
70 uint32_t frame_msg1;
74 uint32_t frame_msg2;
78 uint32_t frame_msg3;
82 uint32_t frame_msg4;
83
84 /* Errors can only be present after #seen_msg1 is true.
85 * But they can be sent from either side of the session.
86 */
90 uint32_t frame_error;
91
93 int64_t method;
95 int64_t suite;
97 const struct edhoc_cs_s *found_cs;
104
106 GBytes *gx_data;
108 GBytes *prk_2e;
110 GBytes *prk_3e2m;
112 GBytes *prk_4e3m;
114 GBytes *prk_out;
117
119
128edhoc_state_t * edhoc_state_new(conversation_t *conv);
129
133void edhoc_state_free(edhoc_state_t *state);
134
145GBytes * edhoc_exporter_kdf(const edhoc_session_t *sess, int64_t label, GBytes *ctx, size_t length);
146
147#endif /* __PACKET_EDHOC_H__ */
Definition wmem_list.c:23
Definition wmem_tree-int.h:48
Definition conversation.h:228
Derived properties of AEAD encryption algorithm.
Definition packet-cose.h:89
Derived properties of AEAD encryption algorithm.
Definition packet-cose.h:113
Derived properties of hash algorithm.
Definition packet-cose.h:68
Definition packet-edhoc.c:173
Definition packet-edhoc.h:61
uint64_t sess_idx
The session index within the state, starting at zero.
Definition packet-edhoc.h:65
bool seen_msg3
True if message 3 has been seen.
Definition packet-edhoc.h:76
uint32_t frame_msg3
The frame of message 3 if seen_msg3 is true.
Definition packet-edhoc.h:78
const cose_aead_props_t * aead_props
Lookup into COSE table for AEAD properties.
Definition packet-edhoc.h:99
bool seen_error
True if an EDHOC error message has been seen so far.
Definition packet-edhoc.h:88
GBytes * prk_exporter
Pointer to derived data owned by this session.
Definition packet-edhoc.h:116
const cose_hash_props_t * hash_props
Lookup into COSE table for hash properties.
Definition packet-edhoc.h:101
GBytes * gx_data
Pointer to extracted message 1 G_X owned by this session.
Definition packet-edhoc.h:106
bool seen_msg1
True if message 1 has been seen.
Definition packet-edhoc.h:68
uint32_t frame_msg1
The frame of message 1 if seen_msg1 is true.
Definition packet-edhoc.h:70
const cose_ecc_props_t * ecc_props
Lookup into COSE table for ECC properties.
Definition packet-edhoc.h:103
GBytes * prk_out
Pointer to derived data owned by this session.
Definition packet-edhoc.h:114
uint32_t frame_error
The frame of the first error if seen_error is true.
Definition packet-edhoc.h:90
uint32_t frame_msg4
The frame of message 4 if seen_msg4 is true.
Definition packet-edhoc.h:82
uint32_t frame_msg2
The frame of message 2 if seen_msg2 is true.
Definition packet-edhoc.h:74
GBytes * prk_3e2m
Pointer to external keyfile PRK data.
Definition packet-edhoc.h:110
bool seen_msg4
True if message 4 has been seen.
Definition packet-edhoc.h:80
bool seen_msg2
True if message 2 has been seen.
Definition packet-edhoc.h:72
edhoc_state_t * parent
The parent protocol state.
Definition packet-edhoc.h:63
GBytes * prk_2e
Pointer to external keyfile PRK data.
Definition packet-edhoc.h:108
int64_t suite
The selected cipher suite from message 1.
Definition packet-edhoc.h:95
const struct edhoc_cs_s * found_cs
Lookup into a static table for suite.
Definition packet-edhoc.h:97
int64_t method
The selected method from message 1.
Definition packet-edhoc.h:93
GBytes * prk_4e3m
Pointer to external keyfile PRK data.
Definition packet-edhoc.h:112
State of one or more sessions within a conversation.
Definition packet-edhoc.h:45
conversation_t * conv
Parent conversation for these sessions.
Definition packet-edhoc.h:47
wmem_tree_t * session_map
Sessions organized by frame number ranges which they cover.
Definition packet-edhoc.h:54
bool prepend_cid
An indicator of whether a CID is expected to be prepended.
Definition packet-edhoc.h:49
wmem_list_t * session_list
Sessions in this state, values are edhoc_session_t *.
Definition packet-edhoc.h:52