| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
packet-nts-ke.h
1/* packet-nts-ke.h
2 *
3 * Copyright (c) 2024 by Martin Mayer <martin.mayer@m2-it-solutions.de>
4 *
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 */
11
12#ifndef __PACKET_NTS_KE_H__
13#define __PACKET_NTS_KE_H__
14
15#include <wsutil/wsgcrypt.h>
16
17#define NTS_KE_TLS13_KEY_MAX_LEN 64
18
19 typedef struct _nts_aead {
20 uint16_t id; /* IANA assigned AEAD parameter ID */
21 uint16_t cipher; /* gcrypt cipher */
22 uint8_t mode; /* gcrypt cipher mode */
23 uint16_t key_len; /* Length of key for this cipher */
24 uint16_t tag_len; /* Length of authentication tag for this cipher */
25} nts_aead;
26
27 typedef struct _nts_cookie_t {
28 uint32_t frame_received; /* Frame no. which provided the cookie */
29 wmem_list_t *frames_used; /* List of frame no. which used the cookie */
30 wmem_list_t *frames_used_uid; /* List of request UIDs which used the cookie */
31 uint16_t aead; /* AEAD parameter */
32 bool keys_present; /* Are keys present (export successful) */
33 uint8_t key_c2s[NTS_KE_TLS13_KEY_MAX_LEN]; /* Derived client to server key */
34 uint8_t key_s2c[NTS_KE_TLS13_KEY_MAX_LEN]; /* Derived server to client key */
35} nts_cookie_t;
36
37/* Helper structure to pass data to nts_append_used_frames_to_tree() */
38 typedef struct _nts_used_frames_lookup_t {
39 tvbuff_t *tvb;
40 proto_tree *tree;
41 int hfindex;
42} nts_used_frames_lookup_t;
43
51 nts_cookie_t* nts_new_cookie(tvbuff_t *tvb, uint16_t aead, packet_info *pinfo);
52
60 nts_cookie_t* nts_new_cookie_copy(tvbuff_t *tvb, nts_cookie_t *ref_cookie, packet_info *pinfo);
61
69 nts_cookie_t* nts_use_cookie(tvbuff_t *tvb_cookie, tvbuff_t *tvb_uid, packet_info *pinfo);
70
76 nts_cookie_t* nts_find_cookie_by_uid(tvbuff_t *tvb_uid);
77
83const nts_aead * nts_find_aead(uint16_t id);
84
89void nts_append_used_frames_to_tree(void *data, void *user_data);
90
91#endif
_nts_aead
Definition packet-nts-ke.h:19
_nts_cookie_t
Definition packet-nts-ke.h:27
_nts_used_frames_lookup_t
Definition packet-nts-ke.h:38
_packet_info
Definition packet_info.h:43
_proto_node
Definition proto.h:907
_wmem_list_t
Definition wmem_list.c:23
tvbuff
Definition tvbuff-int.h:35
wsgcrypt.h