Coverage Report

Created: 2026-07-12 07:10

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-tls-utils.h
Line
Count
Source
1
/* packet-tls-utils.h
2
 * ssl manipulation functions
3
 * By Paolo Abeni <paolo.abeni@email.com>
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_TLS_UTILS_H__
13
#define __PACKET_TLS_UTILS_H__
14
15
#include <stdio.h>      /* some APIs we declare take a stdio stream as an argument */
16
17
#include <glib.h>
18
#include <epan/packet.h>
19
#include <epan/prefs.h>
20
#include <epan/wmem_scopes.h>
21
#include <epan/expert.h>
22
#include <epan/conversation.h>
23
#include <epan/tap.h>
24
#include <epan/unit_strings.h>
25
#include <wsutil/wsgcrypt.h>
26
27
/* TODO inline this now that Libgcrypt is mandatory? */
28
#define SSL_CIPHER_CTX gcry_cipher_hd_t
29
#define SSL_DECRYPT_DEBUG
30
31
32
/* other defines */
33
typedef enum {
34
    SSL_ID_CHG_CIPHER_SPEC         = 0x14,
35
    SSL_ID_ALERT                   = 0x15,
36
    SSL_ID_HANDSHAKE               = 0x16,
37
    SSL_ID_APP_DATA                = 0x17,
38
    SSL_ID_HEARTBEAT               = 0x18,
39
    SSL_ID_TLS12_CID               = 0x19,
40
    SSL_ID_DTLS13_ACK              = 0x1A,
41
} ContentType;
42
43
typedef enum {
44
    SSL_HND_HELLO_REQUEST          = 0,
45
    SSL_HND_CLIENT_HELLO           = 1,
46
    SSL_HND_SERVER_HELLO           = 2,
47
    SSL_HND_HELLO_VERIFY_REQUEST   = 3,
48
    SSL_HND_NEWSESSION_TICKET      = 4,
49
    SSL_HND_END_OF_EARLY_DATA      = 5,
50
    SSL_HND_HELLO_RETRY_REQUEST    = 6,
51
    SSL_HND_ENCRYPTED_EXTENSIONS   = 8,
52
    SSL_HND_CERTIFICATE            = 11,
53
    SSL_HND_SERVER_KEY_EXCHG       = 12,
54
    SSL_HND_CERT_REQUEST           = 13,
55
    SSL_HND_SVR_HELLO_DONE         = 14,
56
    SSL_HND_CERT_VERIFY            = 15,
57
    SSL_HND_CLIENT_KEY_EXCHG       = 16,
58
    SSL_HND_FINISHED               = 20,
59
    SSL_HND_CERT_URL               = 21,
60
    SSL_HND_CERT_STATUS            = 22,
61
    SSL_HND_SUPPLEMENTAL_DATA      = 23,
62
    SSL_HND_KEY_UPDATE             = 24,
63
    SSL_HND_COMPRESSED_CERTIFICATE = 25,
64
    /* Encrypted Extensions was NextProtocol in draft-agl-tls-nextprotoneg-03
65
     * and changed in draft 04. Not to be confused with TLS 1.3 EE. */
66
    SSL_HND_ENCRYPTED_EXTS         = 67,
67
    SSL_HND_MESSAGE_HASH           = 254
68
} HandshakeType;
69
70
12
#define SSL2_HND_ERROR                 0x00
71
227
#define SSL2_HND_CLIENT_HELLO          0x01
72
54
#define SSL2_HND_CLIENT_MASTER_KEY     0x02
73
0
#define SSL2_HND_CLIENT_FINISHED       0x03
74
100
#define SSL2_HND_SERVER_HELLO          0x04
75
0
#define SSL2_HND_SERVER_VERIFY         0x05
76
0
#define SSL2_HND_SERVER_FINISHED       0x06
77
0
#define SSL2_HND_REQUEST_CERTIFICATE   0x07
78
0
#define SSL2_HND_CLIENT_CERTIFICATE    0x08
79
80
6.91k
#define SSL_HND_HELLO_EXT_SERVER_NAME                   0
81
15
#define SSL_HND_HELLO_EXT_MAX_FRAGMENT_LENGTH           1
82
#define SSL_HND_HELLO_EXT_CLIENT_CERTIFICATE_URL        2
83
53
#define SSL_HND_HELLO_EXT_TRUSTED_CA_KEYS               3
84
#define SSL_HND_HELLO_EXT_TRUNCATED_HMAC                4
85
65
#define SSL_HND_HELLO_EXT_STATUS_REQUEST                5
86
#define SSL_HND_HELLO_EXT_USER_MAPPING                  6
87
#define SSL_HND_HELLO_EXT_CLIENT_AUTHZ                  7
88
#define SSL_HND_HELLO_EXT_SERVER_AUTHZ                  8
89
123
#define SSL_HND_HELLO_EXT_CERT_TYPE                     9
90
80
#define SSL_HND_HELLO_EXT_SUPPORTED_GROUPS              10 /* renamed from "elliptic_curves" (RFC 7919 / TLS 1.3) */
91
43
#define SSL_HND_HELLO_EXT_EC_POINT_FORMATS              11
92
17
#define SSL_HND_HELLO_EXT_SRP                           12
93
24
#define SSL_HND_HELLO_EXT_SIGNATURE_ALGORITHMS          13
94
7
#define SSL_HND_HELLO_EXT_USE_SRTP                      14
95
7
#define SSL_HND_HELLO_EXT_HEARTBEAT                     15
96
1.10k
#define SSL_HND_HELLO_EXT_ALPN                          16
97
12
#define SSL_HND_HELLO_EXT_STATUS_REQUEST_V2             17
98
13
#define SSL_HND_HELLO_EXT_SIGNED_CERTIFICATE_TIMESTAMP  18
99
23
#define SSL_HND_HELLO_EXT_CLIENT_CERT_TYPE              19
100
57
#define SSL_HND_HELLO_EXT_SERVER_CERT_TYPE              20
101
2
#define SSL_HND_HELLO_EXT_PADDING                       21
102
19
#define SSL_HND_HELLO_EXT_ENCRYPT_THEN_MAC              22
103
6
#define SSL_HND_HELLO_EXT_EXTENDED_MASTER_SECRET        23
104
26
#define SSL_HND_HELLO_EXT_TOKEN_BINDING                 24
105
#define SSL_HND_HELLO_EXT_CACHED_INFO                   25
106
42
#define SSL_HND_HELLO_EXT_COMPRESS_CERTIFICATE          27
107
1
#define SSL_HND_HELLO_EXT_RECORD_SIZE_LIMIT             28
108
/* 26-33  Unassigned*/
109
5
#define SSL_HND_HELLO_EXT_DELEGATED_CREDENTIALS         34 /* draft-ietf-tls-subcerts-10.txt */
110
23
#define SSL_HND_HELLO_EXT_SESSION_TICKET_TLS            35
111
/* RFC 8446 (TLS 1.3) */
112
28
#define SSL_HND_HELLO_EXT_KEY_SHARE_OLD                 40 /* draft-ietf-tls-tls13-22 (removed in -23) */
113
27
#define SSL_HND_HELLO_EXT_PRE_SHARED_KEY                41
114
9
#define SSL_HND_HELLO_EXT_EARLY_DATA                    42
115
593
#define SSL_HND_HELLO_EXT_SUPPORTED_VERSIONS            43
116
11
#define SSL_HND_HELLO_EXT_COOKIE                        44
117
27
#define SSL_HND_HELLO_EXT_PSK_KEY_EXCHANGE_MODES        45
118
30
#define SSL_HND_HELLO_EXT_TICKET_EARLY_DATA_INFO        46 /* draft-ietf-tls-tls13-18 (removed in -19) */
119
30
#define SSL_HND_HELLO_EXT_CERTIFICATE_AUTHORITIES       47
120
31
#define SSL_HND_HELLO_EXT_OID_FILTERS                   48
121
6
#define SSL_HND_HELLO_EXT_POST_HANDSHAKE_AUTH           49
122
24
#define SSL_HND_HELLO_EXT_SIGNATURE_ALGORITHMS_CERT     50
123
56
#define SSL_HND_HELLO_EXT_KEY_SHARE                     51
124
#define SSL_HND_HELLO_EXT_TRANSPARENCY_INFO             52 /* draft-ietf-trans-rfc6962-bis-41 */
125
9
#define SSL_HND_HELLO_EXT_CONNECTION_ID_DEPRECATED      53 /* draft-ietf-tls-dtls-connection-id-07 */
126
18
#define SSL_HND_HELLO_EXT_CONNECTION_ID                 54
127
#define SSL_HND_HELLO_EXT_EXTERNAL_ID_HASH              55 /* RFC 8844 */
128
#define SSL_HND_HELLO_EXT_EXTERNAL_SESSION_ID           56 /* RFC 8844 */
129
248
#define SSL_HND_HELLO_EXT_QUIC_TRANSPORT_PARAMETERS_V1  57 /* draft-ietf-quic-tls-33 */
130
#define SSL_HND_HELLO_EXT_TICKET_REQUEST                58 /* draft-ietf-tls-ticketrequests-07 */
131
#define SSL_HND_HELLO_EXT_DNSSEC_CHAIN                  59 /* RFC 9102 */
132
#define SSL_HND_HELLO_EXT_GREASE_0A0A                   2570
133
#define SSL_HND_HELLO_EXT_GREASE_1A1A                   6682
134
#define SSL_HND_HELLO_EXT_GREASE_2A2A                   10794
135
0
#define SSL_HND_HELLO_EXT_NPN                           13172 /* 0x3374 */
136
#define SSL_HND_HELLO_EXT_GREASE_3A3A                   14906
137
0
#define SSL_HND_HELLO_EXT_ALPS_OLD                      17513 /* draft-vvv-tls-alps-01, previous value used in BoringSSL implementation */
138
0
#define SSL_HND_HELLO_EXT_ALPS                          17613 /* draft-vvv-tls-alps-01, current value used in BoringSSL implementation */
139
#define SSL_HND_HELLO_EXT_GREASE_4A4A                   19018
140
#define SSL_HND_HELLO_EXT_GREASE_5A5A                   23130
141
#define SSL_HND_HELLO_EXT_GREASE_6A6A                   27242
142
#define SSL_HND_HELLO_EXT_CHANNEL_ID_OLD                30031 /* 0x754f */
143
#define SSL_HND_HELLO_EXT_CHANNEL_ID                    30032 /* 0x7550 */
144
#define SSL_HND_HELLO_EXT_GREASE_7A7A                   31354
145
#define SSL_HND_HELLO_EXT_GREASE_8A8A                   35466
146
#define SSL_HND_HELLO_EXT_GREASE_9A9A                   39578
147
#define SSL_HND_HELLO_EXT_GREASE_AAAA                   43690
148
#define SSL_HND_HELLO_EXT_GREASE_BABA                   47802
149
#define SSL_HND_HELLO_EXT_GREASE_CACA                   51914
150
#define SSL_HND_HELLO_EXT_GREASE_DADA                   56026
151
#define SSL_HND_HELLO_EXT_GREASE_EAEA                   60138
152
#define SSL_HND_HELLO_EXT_GREASE_FAFA                   64250
153
25
#define SSL_HND_HELLO_EXT_ECH_OUTER_EXTENSIONS          64768 /* 0xfd00 draft-ietf-tls-esni-16 */
154
16
#define SSL_HND_HELLO_EXT_ENCRYPTED_CLIENT_HELLO        65037 /* 0xfe0d draft-ietf-tls-esni-16 */
155
19
#define SSL_HND_HELLO_EXT_RENEGOTIATION_INFO            65281 /* 0xFF01 */
156
1
#define SSL_HND_HELLO_EXT_QUIC_TRANSPORT_PARAMETERS     65445 /* 0xffa5 draft-ietf-quic-tls-13 */
157
2
#define SSL_HND_HELLO_EXT_ENCRYPTED_SERVER_NAME         65486 /* 0xffce draft-ietf-tls-esni-01 */
158
159
#define SSL_HND_CERT_URL_TYPE_INDIVIDUAL_CERT       1
160
#define SSL_HND_CERT_URL_TYPE_PKIPATH               2
161
19
#define SSL_HND_CERT_STATUS_TYPE_OCSP        1
162
30
#define SSL_HND_CERT_STATUS_TYPE_OCSP_MULTI  2
163
142
#define SSL_HND_CERT_TYPE_RAW_PUBLIC_KEY     2
164
165
/* https://github.com/quicwg/base-drafts/wiki/Temporary-IANA-Registry#quic-transport-parameters */
166
892
#define SSL_HND_QUIC_TP_ORIGINAL_DESTINATION_CONNECTION_ID  0x00
167
189
#define SSL_HND_QUIC_TP_MAX_IDLE_TIMEOUT                    0x01
168
61
#define SSL_HND_QUIC_TP_STATELESS_RESET_TOKEN               0x02
169
105
#define SSL_HND_QUIC_TP_MAX_UDP_PAYLOAD_SIZE                0x03
170
460
#define SSL_HND_QUIC_TP_INITIAL_MAX_DATA                    0x04
171
149
#define SSL_HND_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL  0x05
172
130
#define SSL_HND_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE 0x06
173
52
#define SSL_HND_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI         0x07
174
105
#define SSL_HND_QUIC_TP_INITIAL_MAX_STREAMS_BIDI            0x08
175
120
#define SSL_HND_QUIC_TP_INITIAL_MAX_STREAMS_UNI             0x09
176
55
#define SSL_HND_QUIC_TP_ACK_DELAY_EXPONENT                  0x0a
177
30
#define SSL_HND_QUIC_TP_MAX_ACK_DELAY                       0x0b
178
16
#define SSL_HND_QUIC_TP_DISABLE_ACTIVE_MIGRATION            0x0c
179
71
#define SSL_HND_QUIC_TP_PREFERRED_ADDRESS                   0x0d
180
9
#define SSL_HND_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT          0x0e
181
18
#define SSL_HND_QUIC_TP_INITIAL_SOURCE_CONNECTION_ID        0x0f
182
26
#define SSL_HND_QUIC_TP_RETRY_SOURCE_CONNECTION_ID          0x10
183
45
#define SSL_HND_QUIC_TP_VERSION_INFORMATION                 0x11 /* https://tools.ietf.org/html/draft-ietf-quic-version-negotiation-14 */
184
10
#define SSL_HND_QUIC_TP_MAX_DATAGRAM_FRAME_SIZE             0x20 /* https://datatracker.ietf.org/doc/html/draft-ietf-quic-datagram-06 */
185
10
#define SSL_HND_QUIC_TP_CIBIR_ENCODING                      0x1000 /* https://datatracker.ietf.org/doc/html/draft-banks-quic-cibir-01 */
186
1
#define SSL_HND_QUIC_TP_LOSS_BITS                           0x1057 /* https://tools.ietf.org/html/draft-ferrieuxhamchaoui-quic-lossbits-03 */
187
0
#define SSL_HND_QUIC_TP_GREASE_QUIC_BIT                     0x2ab2 /* RFC 9287 */
188
0
#define SSL_HND_QUIC_TP_ENABLE_TIME_STAMP                   0x7157 /* https://tools.ietf.org/html/draft-huitema-quic-ts-02 */
189
0
#define SSL_HND_QUIC_TP_ENABLE_TIME_STAMP_V2                0x7158 /* https://tools.ietf.org/html/draft-huitema-quic-ts-03 */
190
0
#define SSL_HND_QUIC_TP_MIN_ACK_DELAY_OLD                   0xde1a /* https://tools.ietf.org/html/draft-iyengar-quic-delayed-ack-00 */
191
/* https://quiche.googlesource.com/quiche/+/refs/heads/master/quic/core/crypto/transport_parameters.cc */
192
0
#define SSL_HND_QUIC_TP_GOOGLE_USER_AGENT                   0x3129
193
0
#define SSL_HND_QUIC_TP_GOOGLE_KEY_UPDATE_NOT_YET_SUPPORTED 0x312B
194
0
#define SSL_HND_QUIC_TP_GOOGLE_QUIC_VERSION                 0x4752
195
0
#define SSL_HND_QUIC_TP_GOOGLE_INITIAL_RTT                  0x3127
196
0
#define SSL_HND_QUIC_TP_GOOGLE_SUPPORT_HANDSHAKE_DONE       0x312A
197
0
#define SSL_HND_QUIC_TP_GOOGLE_QUIC_PARAMS                  0x4751
198
0
#define SSL_HND_QUIC_TP_GOOGLE_CONNECTION_OPTIONS           0x3128
199
/* https://github.com/facebookincubator/mvfst/blob/master/quic/QuicConstants.h */
200
2
#define SSL_HND_QUIC_TP_FACEBOOK_PARTIAL_RELIABILITY        0xFF00
201
0
#define SSL_HND_QUIC_TP_VERSION_INFORMATION_DRAFT           0xff73db /* https://datatracker.ietf.org/doc/draft-ietf-quic-version-negotiation/13/ */
202
0
#define SSL_HND_QUIC_TP_ADDRESS_DISCOVERY                   0x9f81a176 /* https://tools.ietf.org/html/draft-ietf-quic-address-discovery-00 */
203
0
#define SSL_HND_QUIC_TP_MIN_ACK_DELAY_DRAFT_V1              0xFF03DE1A /* https://tools.ietf.org/html/draft-ietf-quic-ack-frequency-01 */
204
0
#define SSL_HND_QUIC_TP_MIN_ACK_DELAY_DRAFT05               0xff04de1a /* https://tools.ietf.org/html/draft-ietf-quic-ack-frequency-04 / draft-05 */
205
0
#define SSL_HND_QUIC_TP_MIN_ACK_DELAY                       0xff04de1b /* https://tools.ietf.org/html/draft-ietf-quic-ack-frequency-07 */
206
0
#define SSL_HND_QUIC_TP_ENABLE_MULTIPATH_DRAFT04            0x0f739bbc1b666d04 /* https://tools.ietf.org/html/draft-ietf-quic-multipath-04 */
207
0
#define SSL_HND_QUIC_TP_ENABLE_MULTIPATH_DRAFT05            0x0f739bbc1b666d05 /* https://tools.ietf.org/html/draft-ietf-quic-multipath-05 */
208
0
#define SSL_HND_QUIC_TP_ENABLE_MULTIPATH                    0x0f739bbc1b666d06 /* https://tools.ietf.org/html/draft-ietf-quic-multipath-06 */
209
0
#define SSL_HND_QUIC_TP_INITIAL_MAX_PATHS                   0x0f739bbc1b666d07 /* https://tools.ietf.org/html/draft-ietf-quic-multipath-07 */
210
0
#define SSL_HND_QUIC_TP_INITIAL_MAX_PATH_ID_DRAFT09         0x0f739bbc1b666d09 /* https://tools.ietf.org/html/draft-ietf-quic-multipath-09 */
211
0
#define SSL_HND_QUIC_TP_INITIAL_MAX_PATH_ID_DRAFT11         0x0f739bbc1b666d11 /* https://tools.ietf.org/html/draft-ietf-quic-multipath-11 */
212
0
#define SSL_HND_QUIC_TP_INITIAL_MAX_PATH_ID_DRAFT12         0x0f739bbc1b666d0c /* https://tools.ietf.org/html/draft-ietf-quic-multipath-12 */
213
0
#define SSL_HND_QUIC_TP_INITIAL_MAX_PATH_ID_DRAFT13         0x0f739bbc1b666d0d /* https://tools.ietf.org/html/draft-ietf-quic-multipath-13 */
214
4
#define SSL_HND_QUIC_TP_INITIAL_MAX_PATH_ID                 0x3e /* https://tools.ietf.org/html/draft-ietf-quic-multipath-19 */
215
216
/*
217
 * Lookup tables
218
 */
219
extern const value_string ssl_version_short_names[];
220
extern const value_string ssl_20_msg_types[];
221
extern value_string_ext ssl_20_cipher_suites_ext;
222
extern const value_string ssl_20_certificate_type[];
223
extern const value_string ssl_31_content_type[];
224
extern const value_string ssl_versions[];
225
extern const value_string ssl_31_change_cipher_spec[];
226
extern const value_string ssl_31_alert_level[];
227
extern const value_string ssl_31_alert_description[];
228
extern const value_string ssl_31_handshake_type[];
229
extern const value_string tls_heartbeat_type[];
230
extern const value_string tls_heartbeat_mode[];
231
extern const value_string ssl_31_compression_method[];
232
extern const value_string ssl_31_key_exchange_algorithm[];
233
extern const value_string ssl_31_signature_algorithm[];
234
extern const value_string ssl_31_client_certificate_type[];
235
extern const value_string ssl_31_public_value_encoding[];
236
extern value_string_ext ssl_31_ciphersuite_ext;
237
extern const value_string tls_hello_extension_types[];
238
extern const value_string tls_hash_algorithm[];
239
extern const value_string tls_signature_algorithm[];
240
extern const value_string tls13_signature_algorithm[];
241
extern const value_string tls_certificate_type[];
242
extern const value_string tls_cert_chain_type[];
243
extern const value_string tls_cert_status_type[];
244
extern const value_string ssl_extension_curves[];
245
extern const value_string ssl_extension_ec_point_formats[];
246
extern const value_string ssl_curve_types[];
247
extern const value_string tls_hello_ext_server_name_type_vs[];
248
extern const value_string tls_hello_ext_max_fragment_length[];
249
extern const value_string tls_hello_ext_psk_ke_mode[];
250
extern const value_string tls_hello_ext_trusted_ca_key_type[];
251
extern const value_string tls13_key_update_request[];
252
extern const value_string compress_certificate_algorithm_vals[];
253
extern const val64_string quic_transport_parameter_id[];
254
extern const range_string quic_version_vals[];
255
extern const val64_string quic_address_discovery_vals[];
256
extern const val64_string quic_enable_time_stamp_v2_vals[];
257
extern const val64_string quic_enable_multipath_vals[];
258
extern const value_string tls_hello_ext_ech_clienthello_types[];
259
extern const value_string kem_id_type_vals[];
260
extern const value_string kdf_id_type_vals[];
261
extern const value_string aead_id_type_vals[];
262
extern const value_string token_binding_key_parameter_vals[];
263
264
/* XXX Should we use GByteArray instead? */
265
typedef struct _StringInfo {
266
    unsigned char  *data;      /* Backing storage which may be larger than data_len */
267
    unsigned data_len;  /* Length of the meaningful part of data */
268
} StringInfo;
269
270
#define SSL_WRITE_KEY           1
271
272
9.58k
#define SSL_VER_UNKNOWN         0
273
153
#define SSLV2_VERSION           0x0002 /* not in record layer, SSL_CLIENT_SERVER from
274
                                          http://www-archive.mozilla.org/projects/security/pki/nss/ssl/draft02.html */
275
1.36k
#define SSLV3_VERSION          0x300
276
10.0k
#define TLSV1_VERSION          0x301
277
6.61k
#define TLCPV1_VERSION         0x101
278
9.75k
#define TLSV1DOT1_VERSION      0x302
279
16.5k
#define TLSV1DOT2_VERSION      0x303
280
39.4k
#define TLSV1DOT3_VERSION      0x304
281
205
#define DTLSV1DOT0_VERSION     0xfeff
282
454
#define DTLSV1DOT0_OPENSSL_VERSION 0x100
283
3.20k
#define DTLSV1DOT2_VERSION     0xfefd
284
5.79k
#define DTLSV1DOT3_VERSION     0xfefc
285
286
/* Returns the TLS 1.3 draft version or 0 if not applicable. */
287
2.38k
static inline uint8_t extract_tls13_draft_version(uint32_t version) {
288
2.38k
    if ((version & 0xff00) == 0x7f00) {
289
77
        return (uint8_t) version;
290
77
    }
291
2.30k
    return 0;
292
2.38k
}
Unexecuted instantiation: packet-dtls.c:extract_tls13_draft_version
Unexecuted instantiation: packet-eap.c:extract_tls13_draft_version
Unexecuted instantiation: packet-enip.c:extract_tls13_draft_version
Unexecuted instantiation: packet-f5ethtrailer.c:extract_tls13_draft_version
Unexecuted instantiation: packet-ftp.c:extract_tls13_draft_version
Unexecuted instantiation: packet-hislip.c:extract_tls13_draft_version
Unexecuted instantiation: packet-imap.c:extract_tls13_draft_version
Unexecuted instantiation: packet-mysql.c:extract_tls13_draft_version
Unexecuted instantiation: packet-nbd.c:extract_tls13_draft_version
Unexecuted instantiation: packet-nntp.c:extract_tls13_draft_version
Unexecuted instantiation: packet-pcp.c:extract_tls13_draft_version
Unexecuted instantiation: packet-pgsql.c:extract_tls13_draft_version
Unexecuted instantiation: packet-pop.c:extract_tls13_draft_version
Unexecuted instantiation: packet-quic.c:extract_tls13_draft_version
Unexecuted instantiation: packet-reload.c:extract_tls13_draft_version
Unexecuted instantiation: packet-smtp.c:extract_tls13_draft_version
Unexecuted instantiation: packet-tcpcl.c:extract_tls13_draft_version
Unexecuted instantiation: packet-telnet.c:extract_tls13_draft_version
packet-tls-utils.c:extract_tls13_draft_version
Line
Count
Source
287
2.38k
static inline uint8_t extract_tls13_draft_version(uint32_t version) {
288
2.38k
    if ((version & 0xff00) == 0x7f00) {
289
77
        return (uint8_t) version;
290
77
    }
291
2.30k
    return 0;
292
2.38k
}
Unexecuted instantiation: packet-tls.c:extract_tls13_draft_version
Unexecuted instantiation: packet-ldap.c:extract_tls13_draft_version
Unexecuted instantiation: packet-xmpp-core.c:extract_tls13_draft_version
293
294
295
3.41k
#define SSL_CLIENT_RANDOM       (1<<0)
296
2.62k
#define SSL_SERVER_RANDOM       (1<<1)
297
2.96k
#define SSL_CIPHER              (1<<2)
298
1.79k
#define SSL_HAVE_SESSION_KEY    (1<<3)
299
2.36k
#define SSL_VERSION             (1<<4)
300
7.09k
#define SSL_MASTER_SECRET       (1<<5)
301
1.60k
#define SSL_PRE_MASTER_SECRET   (1<<6)
302
745
#define SSL_CLIENT_EXTENDED_MASTER_SECRET (1<<7)
303
475
#define SSL_SERVER_EXTENDED_MASTER_SECRET (1<<8)
304
500
#define SSL_NEW_SESSION_TICKET  (1<<10)
305
1
#define SSL_ENCRYPT_THEN_MAC    (1<<11)
306
15
#define SSL_SEEN_0RTT_APPDATA   (1<<12)
307
947
#define SSL_QUIC_RECORD_LAYER   (1<<13) /* For QUIC (draft >= -13) */
308
309
0
#define SSL_EXTENDED_MASTER_SECRET_MASK (SSL_CLIENT_EXTENDED_MASTER_SECRET|SSL_SERVER_EXTENDED_MASTER_SECRET)
310
311
/* SSL Cipher Suite modes */
312
typedef enum {
313
    MODE_STREAM,    /* GenericStreamCipher */
314
    MODE_CBC,       /* GenericBlockCipher */
315
    MODE_GCM,       /* GenericAEADCipher */
316
    MODE_CCM,       /* AEAD_AES_{128,256}_CCM with 16 byte auth tag */
317
    MODE_CCM_8,     /* AEAD_AES_{128,256}_CCM with 8 byte auth tag */
318
    MODE_POLY1305,  /* AEAD_CHACHA20_POLY1305 with 16 byte auth tag (RFC 7905) */
319
    MODE_ECB, /* ECB: used to perform record seq number encryption in DTLSv1.3 */
320
} ssl_cipher_mode_t;
321
322
/* Explicit and implicit nonce length (RFC 5116 - Section 3.2.1) */
323
0
#define IMPLICIT_NONCE_LEN  4
324
0
#define EXPLICIT_NONCE_LEN  8
325
24
#define TLS13_AEAD_NONCE_LENGTH     12
326
327
/* TLS 1.3 Record type for selecting the appropriate secret. */
328
typedef enum {
329
    TLS_SECRET_0RTT_APP,
330
    TLS_SECRET_HANDSHAKE,
331
    TLS_SECRET_APP,
332
} TLSRecordType;
333
334
0
#define SSL_DEBUG_USE_STDERR "-"
335
336
98
#define SSLV2_MAX_SESSION_ID_LENGTH_IN_BYTES 16
337
338
/* Record fragment lengths MUST NOT exceed 2^14 (= 0x4000) */
339
4.34k
#define TLS_MAX_RECORD_LENGTH 0x4000
340
341
typedef struct _SslCipherSuite {
342
    int number;
343
    int kex;
344
    int enc;
345
    int dig;
346
    ssl_cipher_mode_t mode;
347
} SslCipherSuite;
348
349
typedef struct _SslFlow {
350
    uint32_t byte_seq;
351
    uint16_t flags;
352
    wmem_tree_t *multisegment_pdus;
353
} SslFlow;
354
355
typedef struct _SslDecompress SslDecompress;
356
357
typedef struct _SslDecoder {
358
    const SslCipherSuite *cipher_suite;
359
    int compression;
360
    unsigned char _mac_key_or_write_iv[48];
361
    StringInfo mac_key; /* for block and stream ciphers */
362
    StringInfo write_iv; /* for AEAD ciphers (at least GCM, CCM) */
363
    SSL_CIPHER_CTX sn_evp; /* used to decrypt serial number in DTLSv1.3 */
364
    SSL_CIPHER_CTX evp;
365
    SslDecompress *decomp;
366
    uint64_t dtls13_epoch;
367
    uint64_t seq;    /**< Implicit (TLS) or explicit (DTLS) record sequence number. */
368
    StringInfo dtls13_aad;  /**< Additional Authenticated Data for DTLS 1.3. */
369
    uint16_t epoch;
370
    SslFlow *flow;
371
    StringInfo app_traffic_secret;  /**< TLS 1.3 application traffic secret (if applicable), wmem file scope. */
372
} SslDecoder;
373
374
207
#define KEX_DHE_DSS     0x10
375
68
#define KEX_DHE_PSK     0x11
376
250
#define KEX_DHE_RSA     0x12
377
86
#define KEX_DH_ANON     0x13
378
171
#define KEX_DH_DSS      0x14
379
200
#define KEX_DH_RSA      0x15
380
137
#define KEX_ECDHE_ECDSA 0x16
381
56
#define KEX_ECDHE_PSK   0x17
382
142
#define KEX_ECDHE_RSA   0x18
383
16
#define KEX_ECDH_ANON   0x19
384
64
#define KEX_ECDH_ECDSA  0x1a
385
93
#define KEX_ECDH_RSA    0x1b
386
114
#define KEX_KRB5        0x1c
387
578
#define KEX_PSK         0x1d
388
1.15k
#define KEX_RSA         0x1e
389
81
#define KEX_RSA_PSK     0x1f
390
14
#define KEX_SRP_SHA     0x20
391
13
#define KEX_SRP_SHA_DSS 0x21
392
14
#define KEX_SRP_SHA_RSA 0x22
393
#define KEX_IS_DH(n)    ((n) >= KEX_DHE_DSS && (n) <= KEX_ECDH_RSA)
394
103
#define KEX_TLS13       0x23
395
4
#define KEX_ECJPAKE     0x24
396
397
#define KEX_ECDHE_SM2   0x25
398
0
#define KEX_ECC_SM2     0x26
399
#define KEX_IBSDH_SM9   0x27
400
#define KEX_IBC_SM9     0x28
401
402
/* Order is significant, must match "ciphers" array in packet-tls-utils.c */
403
404
0
#define ENC_START       0x30
405
#define ENC_DES         0x30
406
#define ENC_3DES        0x31
407
#define ENC_RC4         0x32
408
#define ENC_RC2         0x33
409
#define ENC_IDEA        0x34
410
0
#define ENC_AES         0x35
411
0
#define ENC_AES256      0x36
412
#define ENC_CAMELLIA128 0x37
413
#define ENC_CAMELLIA256 0x38
414
#define ENC_SEED        0x39
415
0
#define ENC_CHACHA20    0x3A
416
#define ENC_SM1         0x3B
417
#define ENC_SM4         0x3C
418
216
#define ENC_NULL        0x3D
419
420
421
437
#define DIG_MD5         0x40
422
23
#define DIG_SHA         0x41
423
0
#define DIG_SHA256      0x42
424
0
#define DIG_SHA384      0x43
425
0
#define DIG_SM3         0x44
426
123
#define DIG_NA          0x45 /* Not Applicable */
427
428
typedef struct {
429
    const char *name;
430
    unsigned len;
431
} SslDigestAlgo;
432
433
typedef struct _SslRecordInfo {
434
    unsigned char *plain_data;     /**< Decrypted data. */
435
    unsigned plain_data_len;       /**< Total length of decrypted data,
436
                                        including the content type and padding
437
                                        if the TLS version supports them. */
438
    unsigned content_len;   /**< Length of the part of the decrypted data
439
                                 corresponding to the record content. */
440
    int     id;             /**< Identifies the exact record within a frame
441
                                 (there can be multiple records in a frame). */
442
    ContentType type;       /**< Content type of the decrypted record data. */
443
    SslFlow *flow;          /**< Flow where this record fragment is a part of.
444
                                 Can be NULL if this record type may not be fragmented. */
445
    uint64_t record_seq;    /**< Implicit (TLS) or explicit (DTLS) record sequence number. */
446
    uint32_t seq;            /**< Data offset within the flow. */
447
    struct _SslRecordInfo* next;
448
} SslRecordInfo;
449
450
/**
451
 * Stored information about a part of a reassembled handshake message. A single
452
 * handshake record is uniquely identified by (record_id, reassembly_id).
453
 */
454
typedef struct _TlsHsFragment {
455
    unsigned   record_id;      /**< Identifies the exact record within a frame
456
                                 (there can be multiple records in a frame). */
457
    unsigned   reassembly_id;  /**< Identifies the reassembly that this fragment is part of. */
458
    uint32_t offset;         /**< Offset within a reassembly. */
459
    uint8_t type;           /**< Handshake type (first byte of the buffer). */
460
    int     is_last : 1;    /**< Whether this fragment completes the message. */
461
    struct _TlsHsFragment *next;
462
} TlsHsFragment;
463
464
typedef struct {
465
    SslRecordInfo *records; /**< Decrypted records within this frame. */
466
    TlsHsFragment *hs_fragments;    /**< Handshake records that are part of a reassembly. */
467
    uint32_t srcport;        /**< Used for Decode As */
468
    uint32_t destport;
469
    uint32_t stream;       /**< Used for Follow Stream */
470
    int cipher;            /**< Cipher at time of Key Exchange handshake message.
471
                                 Session cipher can change in renegotiation. */
472
} SslPacketInfo;
473
474
typedef struct _SslSession {
475
    int cipher;
476
    int compression;
477
    uint16_t version;
478
    unsigned char tls13_draft_version;
479
    unsigned char _client_random[32];
480
    int8_t client_cert_type;
481
    int8_t server_cert_type;
482
    uint32_t client_ccs_frame;
483
    uint32_t server_ccs_frame;
484
    uint32_t first_ch_ech_frame;
485
    StringInfo client_random;
486
    bool ech;
487
    bool hrr_ech_declined;
488
    unsigned char ech_confirmation[8];
489
    unsigned char hrr_ech_confirmation[8];
490
    unsigned char first_ech_auth_tag[16];
491
492
    /* The address/proto/port of the server as determined from heuristics
493
     * (e.g. ClientHello) or set externally (via ssl_set_master_secret()). */
494
    address srv_addr;
495
    port_type srv_ptype;
496
    unsigned srv_port;
497
498
    uint32_t stream;
499
500
    /* The Application layer protocol if known (for STARTTLS support) */
501
    dissector_handle_t   app_handle;
502
    const char          *alpn_name;
503
    /* The ALPN the client requested, not necessarily the one chosen */
504
    const char          *client_alpn_name;
505
    uint32_t             last_nontls_frame;
506
    bool                 is_session_resumed;
507
508
    /* First pass only: track an in-progress handshake reassembly (>0) */
509
    uint32_t    client_hs_reassembly_id;
510
    uint32_t    server_hs_reassembly_id;
511
512
    /* Connection ID extension
513
514
    struct {
515
        opaque cid<0..2^8-1>;
516
    } ConnectionId;
517
    */
518
519
    uint8_t *client_cid;
520
    uint8_t *server_cid;
521
    uint8_t client_cid_len;
522
    bool client_cid_len_present;
523
    uint8_t server_cid_len;
524
    bool server_cid_len_present;
525
    bool deprecated_cid; /* Set when handshake is using the deprecated CID extension type */
526
    uint64_t dtls13_current_epoch[2]; /* max epoch (for server and client respectively) */
527
    uint64_t dtls13_next_seq_num[2]; /* DTLSv1.3 next expected seq number (for server and client respectively) */
528
} SslSession;
529
530
/* RFC 5246, section 8.1 says that the master secret is always 48 bytes */
531
0
#define SSL_MASTER_SECRET_LENGTH        48
532
533
struct cert_key_id; /* defined in epan/secrets.h */
534
535
/* This holds state information for a SSL conversation */
536
typedef struct _SslDecryptSession {
537
    unsigned char _master_secret[SSL_MASTER_SECRET_LENGTH];
538
    unsigned char _session_id[256];
539
    unsigned char _client_random[32];
540
    unsigned char _server_random[32];
541
    StringInfo session_id;
542
    StringInfo session_ticket;
543
    StringInfo server_random;
544
    StringInfo client_random;
545
    StringInfo master_secret;
546
    StringInfo handshake_data;
547
    /* the data store for this StringInfo must be allocated explicitly with a capture lifetime scope */
548
    StringInfo pre_master_secret;
549
    unsigned char _server_data_for_iv[24];
550
    StringInfo server_data_for_iv;
551
    unsigned char _client_data_for_iv[24];
552
    StringInfo client_data_for_iv;
553
554
    int state;
555
    const SslCipherSuite *cipher_suite;
556
    SslDecoder *server;
557
    SslDecoder *client;
558
    SslDecoder *server_new;
559
    SslDecoder *client_new;
560
#if defined(HAVE_LIBGNUTLS)
561
    struct cert_key_id *cert_key_id;   /**< SHA-1 Key ID of public key in certificate. */
562
#endif
563
    StringInfo psk;
564
    StringInfo app_data_segment;
565
    SslSession session;
566
    bool       has_early_data;
567
    bool       has_psk;
568
    bool       has_key_share;
569
    StringInfo ech_transcript;
570
571
} SslDecryptSession;
572
573
/* RecordNumber - RFC 9147 section 4 */
574
typedef struct {
575
    uint64_t epoch;
576
    uint64_t sequence_number;
577
} SslRecordNumber;
578
579
/* User Access Table */
580
typedef struct _ssldecrypt_assoc_t {
581
    char* ipaddr;
582
    char* port;
583
    char* protocol;
584
    char* keyfile;
585
    char* password;
586
} ssldecrypt_assoc_t;
587
588
typedef struct ssl_common_options {
589
    const char         *psk;
590
    const char         *keylog_filename;
591
} ssl_common_options_t;
592
593
/** Map from something to a (pre-)master secret */
594
typedef struct {
595
    GHashTable *session;    /* Session ID (1-32 bytes) to master secret. */
596
    GHashTable *tickets;    /* Session Ticket to master secret. */
597
    GHashTable *crandom;    /* Client Random to master secret */
598
    GHashTable *pre_master; /* First 8 bytes of encrypted pre-master secret to
599
                               pre-master secret */
600
    GHashTable *pms;        /* Client Random to unencrypted pre-master secret */
601
602
    /* For TLS 1.3: maps Client Random to derived secret. */
603
    GHashTable *tls13_client_early;
604
    GHashTable *tls13_client_handshake;
605
    GHashTable *tls13_server_handshake;
606
    GHashTable *tls13_client_appdata;
607
    GHashTable *tls13_server_appdata;
608
    GHashTable *tls13_early_exporter;
609
    GHashTable *tls13_exporter;
610
    GHashTable *ech_secret;
611
    GHashTable *ech_config;
612
613
    /* The hash tables above store the static keylog file contents and secrets
614
     * from any DSB, not all of which may be used, in addition to any master
615
     * secrets derived at runtime ([D]TLS < 1.3). These store the used
616
     * Client Random for exporting master secrets and derived secrets in
617
     * TLS Export Sessions or adding a DSB.
618
     */
619
    GHashTable *used_crandom;
620
} ssl_master_key_map_t;
621
622
int ssl_get_keyex_alg(int cipher);
623
624
void quic_transport_parameter_id_base_custom(char *result, uint64_t parameter_id);
625
626
bool ssldecrypt_uat_fld_ip_chk_cb(void*, const char*, unsigned, const void*, const void*, char** err);
627
bool ssldecrypt_uat_fld_port_chk_cb(void*, const char*, unsigned, const void*, const void*, char** err);
628
bool ssldecrypt_uat_fld_fileopen_chk_cb(void*, const char*, unsigned, const void*, const void*, char** err);
629
bool ssldecrypt_uat_fld_password_chk_cb(void*, const char*, unsigned, const void*, const void*, char** err);
630
char* ssl_association_info(const char* dissector_table_name, const char* table_protocol);
631
632
/** Initialize the list of sessions with connection ID */
633
void ssl_init_cid_list(void);
634
635
/** Release resource allocated for the list of sessions with connection ID */
636
void ssl_cleanup_cid_list(void);
637
638
/** Add a session to the list of sessions using connection ID */
639
void ssl_add_session_by_cid(SslDecryptSession *ssl);
640
641
/**
642
 * Return a session with a matching connection ID
643
 * @param tvb a buffer containing a connection ID
644
 * @param offset offset of the connection ID in tvb
645
 */
646
SslDecryptSession *ssl_get_session_by_cid(tvbuff_t *tvb, uint32_t offset);
647
648
/** Retrieve a SslSession, creating it if it did not already exist.
649
 * @param conversation The SSL conversation.
650
 * @param tls_handle The dissector handle for SSL or DTLS.
651
 * @param curr_layer_num The current protocol layer number (for nested TLS support).
652
 */
653
extern SslDecryptSession *
654
ssl_get_session(conversation_t *conversation, dissector_handle_t tls_handle, uint8_t curr_layer_num);
655
656
/** Look up an existing SslDecryptSession for a conversation without creating one.
657
 * Used by functions that query session state (cipher info, ALPN, exporters, etc.)
658
 * but must not create a new session as a side effect.
659
 * @param conversation The SSL conversation (may be NULL, returns NULL in that case).
660
 * @param proto_ssl The protocol index for TLS/DTLS.
661
 * @param curr_layer_num [D]TLS layer nesting number.
662
 * @return The existing SslDecryptSession, or NULL if none is found.
663
 */
664
extern SslDecryptSession *
665
tls_get_session(conversation_t *conversation, int proto_ssl, uint8_t curr_layer_num);
666
667
/** Resets the decryption parameters for the next decoder. */
668
extern void
669
ssl_reset_session(SslSession *session, SslDecryptSession *ssl, bool is_client);
670
671
/** Set server address and port */
672
extern void
673
ssl_set_server(SslSession *session, address *addr, port_type ptype, uint32_t port);
674
675
/** Sets the application data protocol dissector. Intended to be called by
676
 * protocols that encapsulate TLS instead of switching to it using STARTTLS.
677
 * @param tls_handle The dissector handle for TLS or DTLS.
678
 * @param pinfo Packet Info.
679
 * @param app_handle Dissector handle for the protocol inside the decrypted
680
 * Application Data record.
681
 */
682
WS_DLL_PUBLIC void
683
tls_set_appdata_dissector(dissector_handle_t tls_handle, packet_info *pinfo,
684
                 dissector_handle_t app_handle);
685
686
/** Marks this packet as the last one before switching to SSL that is supposed
687
 * to encapsulate this protocol.
688
 * @param tls_handle The dissector handle for SSL or DTLS.
689
 * @param pinfo Packet Info.
690
 * @param app_handle Dissector handle for the protocol inside the decrypted
691
 * Application Data record.
692
 * @return 0 for the first STARTTLS acknowledgement (success) or if tls_handle
693
 * is NULL. >0 if STARTTLS was started before.
694
 */
695
WS_DLL_PUBLIC uint32_t
696
ssl_starttls_ack(dissector_handle_t tls_handle, packet_info *pinfo,
697
                 dissector_handle_t app_handle);
698
699
/** Marks this packet as belonging to an SSL conversation started with STARTTLS.
700
 * @param tls_handle The dissector handle for SSL or DTLS.
701
 * @param pinfo Packet Info.
702
 * @param app_handle Dissector handle for the protocol inside the decrypted
703
 * Application Data record.
704
 * @return 0 for the first STARTTLS acknowledgement (success) or if tls_handle
705
 * is NULL. >0 if STARTTLS was started before.
706
 */
707
WS_DLL_PUBLIC uint32_t
708
ssl_starttls_post_ack(dissector_handle_t tls_handle, packet_info *pinfo,
709
                 dissector_handle_t app_handle);
710
711
extern dissector_handle_t
712
ssl_find_appdata_dissector(const char *name);
713
714
/** set the data and len for the stringInfo buffer. buf should be big enough to
715
 * contain the provided data
716
 @param buf the buffer to update
717
 @param src the data source
718
 @param len the source data len */
719
extern void
720
ssl_data_set(StringInfo* buf, const unsigned char* src, unsigned len);
721
722
/** alloc the data with the specified len for the stringInfo buffer.
723
 @param str the data source
724
 @param len the source data len */
725
extern int
726
ssl_data_alloc(StringInfo* str, size_t len);
727
728
extern int
729
ssl_cipher_setiv(SSL_CIPHER_CTX *cipher, unsigned char* iv, int iv_len);
730
731
/** Search for the specified cipher suite id
732
 @param num the id of the cipher suite to be searched
733
 @return pointer to the cipher suite struct (or NULL if not found). */
734
extern const SslCipherSuite *
735
ssl_find_cipher(int num);
736
737
738
/** Returns the Libgcrypt cipher identifier or 0 if unavailable. */
739
int
740
ssl_get_cipher_algo(const SslCipherSuite *cipher_suite);
741
742
/** Obtains the block size for a CBC block cipher.
743
 * @param cipher_suite a cipher suite as returned by ssl_find_cipher().
744
 * @return the block size of a cipher or 0 if unavailable.
745
 */
746
unsigned
747
ssl_get_cipher_blocksize(const SslCipherSuite *cipher_suite);
748
749
bool
750
ssl_generate_pre_master_secret(SslDecryptSession *ssl_session,
751
                               uint32_t length, tvbuff_t *tvb, uint32_t offset,
752
                               const char *ssl_psk, packet_info *pinfo,
753
#ifdef HAVE_LIBGNUTLS
754
                               GHashTable *key_hash,
755
#endif
756
                               const ssl_master_key_map_t *mk_map);
757
758
/** Expand the pre_master_secret to generate all the session information
759
 * (master secret, session keys, ivs)
760
 @param ssl_session the store for all the session data
761
 @return 0 on success */
762
extern int
763
ssl_generate_keyring_material(SslDecryptSession*ssl_session);
764
765
extern void
766
ssl_change_cipher(SslDecryptSession *ssl_session, bool server);
767
768
/** Try to decrypt an ssl record
769
 @param allocator scope allocation of the decrypted data
770
 @param ssl ssl_session the store all the session data
771
 @param decoder the stream decoder to be used
772
 @param ct the content type of this ssl record
773
 @param record_version the version as contained in the record
774
 @param ignore_mac_failed whether to ignore MAC or authenticity failures
775
 @param in a pointer to the ssl record to be decrypted
776
 @param inl the record length
777
 @param cid a pointer to the connection ID to use in AEAD or NULL
778
 @param cidl the connection ID length or 0 if cid is NULL
779
 @param comp_str a pointer to the store the compression data
780
 @param out_str a pointer to the store for the decrypted data
781
 @param outl the decrypted data len
782
 @return 0 on success */
783
extern int
784
ssl_decrypt_record(wmem_allocator_t* allocator, SslDecryptSession *ssl, SslDecoder *decoder, uint8_t ct, uint16_t record_version,
785
        bool ignore_mac_failed,
786
        const unsigned char *in, uint16_t inl, const unsigned char *cid, uint8_t cidl,
787
        StringInfo *comp_str, StringInfo *out_str, unsigned *outl);
788
789
790
/* Common part between TLS and DTLS dissectors */
791
792
/* handling of association between tls/dtls ports and clear text protocol */
793
extern void
794
ssl_association_add(const char* dissector_table_name, dissector_handle_t main_handle, dissector_handle_t subdissector_handle, unsigned port, bool tcp);
795
796
extern void
797
ssl_association_remove(const char* dissector_table_name, dissector_handle_t main_handle, dissector_handle_t subdissector_handle, unsigned port, bool tcp);
798
799
extern int
800
ssl_packet_from_server(SslSession *session, dissector_table_t table, const packet_info *pinfo);
801
802
/* Obtain information about the current TLS layer. */
803
SslPacketInfo *
804
tls_add_packet_info(int proto, packet_info *pinfo, uint8_t curr_layer_num_ssl);
805
806
/* add to packet data a copy of the specified real data */
807
extern void
808
ssl_add_record_info(int proto, packet_info *pinfo,
809
                    const unsigned char *plain_data, int plain_data_len, int content_len,
810
                    int record_id, SslFlow *flow, ContentType type, uint8_t curr_layer_num_ssl,
811
                    uint64_t record_seq);
812
813
/* search in packet data for the specified id; return a newly created tvb for the associated data */
814
extern tvbuff_t*
815
ssl_get_record_info(tvbuff_t *parent_tvb, int proto, packet_info *pinfo, int record_id, uint8_t curr_layer_num_ssl, SslRecordInfo **matched_record);
816
817
/* initialize/reset per capture state data (ssl sessions cache) */
818
extern void
819
ssl_common_init(ssl_master_key_map_t *master_key_map,
820
                StringInfo *decrypted_data, StringInfo *compressed_data);
821
extern void
822
ssl_common_cleanup(ssl_master_key_map_t *master_key_map, FILE **ssl_keylog_file,
823
                   StringInfo *decrypted_data, StringInfo *compressed_data);
824
825
/**
826
 * Access to the keys in the TLS dissector, for use by the DTLS dissector.
827
 * (This is a transition function, it would be nice if the static keylog file
828
 * contents was separated from keys derived at runtime.)
829
 */
830
WS_DLL_PUBLIC ssl_master_key_map_t *
831
tls_get_master_key_map(bool load_secrets);
832
833
extern bool
834
tls_load_psk(SslDecryptSession *tls_session, const char *tls_psk);
835
836
/* Process lines from the TLS key log and populate the secrets map. */
837
extern void
838
tls_keylog_process_lines(const ssl_master_key_map_t *mk_map, const uint8_t *data, unsigned len);
839
840
/* tries to update the secrets cache from the given filename */
841
extern void
842
ssl_load_keyfile(const char *ssl_keylog_filename, FILE **keylog_file,
843
                 const ssl_master_key_map_t *mk_map);
844
845
#ifdef HAVE_LIBGNUTLS
846
/* parse ssl related preferences (private keys and ports association strings) */
847
extern void
848
ssl_parse_key_list(const ssldecrypt_assoc_t * uats, GHashTable *key_hash, const char* dissector_table_name, dissector_handle_t main_handle, bool tcp);
849
#endif
850
851
extern void
852
ssl_finalize_decryption(SslDecryptSession *ssl, ssl_master_key_map_t *mk_map);
853
854
/**
855
 * Mark a Client Random as used (not just present in the keylog file),
856
 * to enable "Export TLS Sessions Keys" or "Inject Secrets"
857
 */
858
extern void
859
tls_save_crandom(SslDecryptSession *ssl, ssl_master_key_map_t *mk_map);
860
861
extern bool
862
tls13_generate_keys(SslDecryptSession *ssl_session, const StringInfo *secret, bool is_from_server);
863
864
extern StringInfo *
865
tls13_load_secret(SslDecryptSession *ssl, ssl_master_key_map_t *mk_map,
866
                  bool is_from_server, TLSRecordType type);
867
868
extern void
869
tls13_change_key(SslDecryptSession *ssl, ssl_master_key_map_t *mk_map,
870
                 bool is_from_server, TLSRecordType type);
871
872
extern void
873
tls13_key_update(SslDecryptSession *ssl, bool is_from_server);
874
875
extern bool
876
ssl_is_valid_content_type(uint8_t type);
877
878
extern bool
879
ssl_is_valid_handshake_type(uint8_t hs_type, bool is_dtls);
880
881
extern bool
882
tls_scan_server_hello(tvbuff_t *tvb, uint32_t offset, uint32_t offset_end,
883
                      uint16_t *server_version, bool *is_hrr);
884
885
extern void
886
ssl_try_set_version(SslSession *session, SslDecryptSession *ssl,
887
                    uint8_t content_type, uint8_t handshake_type,
888
                    bool is_dtls, uint16_t version);
889
890
extern void
891
ssl_calculate_handshake_hash(SslDecryptSession *ssl_session, tvbuff_t *tvb, uint32_t offset, uint32_t length, uint8_t msg_type, bool is_from_server);
892
893
/* common header fields, subtrees and expert info for SSL and DTLS dissectors */
894
typedef struct ssl_common_dissect {
895
    struct {
896
        int change_cipher_spec;
897
        int hs_exts_len;
898
        int hs_ext_alpn_len;
899
        int hs_ext_alpn_list;
900
        int hs_ext_alpn_str;
901
        int hs_ext_alpn_str_len;
902
        int hs_ext_cert_url_item;
903
        int hs_ext_cert_url_padding;
904
        int hs_ext_cert_url_sha1;
905
        int hs_ext_cert_url_type;
906
        int hs_ext_cert_url_url;
907
        int hs_ext_cert_url_url_hash_list_len;
908
        int hs_ext_cert_url_url_len;
909
        int hs_ext_cert_status_type;
910
        int hs_ext_cert_status_request_len;
911
        int hs_ext_cert_status_responder_id_list_len;
912
        int hs_ext_cert_status_request_extensions_len;
913
        int hs_ext_cert_status_request_list_len;
914
        int hs_ocsp_response_list_len;
915
        int hs_ocsp_response_len;
916
        int hs_ext_cert_type;
917
        int hs_ext_cert_types;
918
        int hs_ext_cert_types_len;
919
        int hs_ext_data;
920
        int hs_ext_ec_point_format;
921
        int hs_ext_ec_point_formats;
922
        int hs_ext_ec_point_formats_len;
923
        int hs_ext_srp_len;
924
        int hs_ext_srp_username;
925
        int hs_ext_supported_group;
926
        int hs_ext_supported_groups;
927
        int hs_ext_supported_groups_len;
928
        int hs_ext_ech_outer_ext;
929
        int hs_ext_ech_outer_ext_len;
930
        int hs_ech_confirm;
931
        int hs_ech_confirm_compute;
932
        int hs_ext_heartbeat_mode;
933
        int hs_ext_len;
934
        int hs_ext_npn_str;
935
        int hs_ext_npn_str_len;
936
        int hs_ext_reneg_info_len;
937
        int hs_ext_reneg_info;
938
        int hs_ext_key_share_client_length;
939
        int hs_ext_key_share_group;
940
        int hs_ext_key_share_key_exchange_length;
941
        int hs_ext_key_share_key_exchange;
942
        int hs_ext_key_share_selected_group;
943
        int hs_ext_psk_identities_length;
944
        int hs_ext_psk_identity_identity_length;
945
        int hs_ext_psk_identity_identity;
946
        int hs_ext_psk_identity_obfuscated_ticket_age;
947
        int hs_ext_psk_binders_length;
948
        int hs_ext_psk_binders;
949
        int hs_ext_psk_binder;
950
        int hs_ext_psk_binder_binder_length;
951
        int hs_ext_psk_binder_binder;
952
        int hs_ext_psk_identity_selected;
953
        int hs_ext_session_ticket;
954
        int hs_ext_supported_versions_len;
955
        int hs_ext_supported_version;
956
        int hs_ext_cookie_len;
957
        int hs_ext_cookie;
958
        int hs_ext_server_name;
959
        int hs_ext_server_name_len;
960
        int hs_ext_server_name_list_len;
961
        int hs_ext_server_name_type;
962
        int hs_ext_max_fragment_length;
963
        int hs_ext_padding_data;
964
        int hs_ext;
965
        int hs_ext_type;
966
        int hs_ext_connection_id_length;
967
        int hs_ext_connection_id;
968
        int hs_ext_trusted_ca_keys_len;
969
        int hs_ext_trusted_ca_keys_list;
970
        int hs_ext_trusted_ca_key;
971
        int hs_ext_trusted_ca_key_type;
972
        int hs_ext_trusted_ca_key_hash;
973
        int hs_ext_trusted_ca_key_dname_len;
974
        int hs_ext_trusted_ca_key_dname;
975
        int hs_sig_hash_alg;
976
        int hs_sig_hash_alg_len;
977
        int hs_sig_hash_algs;
978
        int hs_sig_hash_hash;
979
        int hs_sig_hash_sig;
980
        int hs_client_keyex_epms_len;
981
        int hs_client_keyex_epms;
982
        int hs_server_keyex_modulus_len;
983
        int hs_server_keyex_exponent_len;
984
        int hs_server_keyex_sig_len;
985
        int hs_server_keyex_p_len;
986
        int hs_server_keyex_g_len;
987
        int hs_server_keyex_ys_len;
988
        int hs_client_keyex_yc_len;
989
        int hs_client_keyex_point_len;
990
        int hs_server_keyex_point_len;
991
        int hs_server_keyex_p;
992
        int hs_server_keyex_g;
993
        int hs_server_keyex_curve_type;
994
        int hs_server_keyex_named_curve;
995
        int hs_server_keyex_ys;
996
        int hs_client_keyex_yc;
997
        int hs_server_keyex_point;
998
        int hs_client_keyex_point;
999
        int hs_server_keyex_xs_len;
1000
        int hs_client_keyex_xc_len;
1001
        int hs_server_keyex_xs;
1002
        int hs_client_keyex_xc;
1003
        int hs_server_keyex_vs_len;
1004
        int hs_client_keyex_vc_len;
1005
        int hs_server_keyex_vs;
1006
        int hs_client_keyex_vc;
1007
        int hs_server_keyex_rs_len;
1008
        int hs_client_keyex_rc_len;
1009
        int hs_server_keyex_rs;
1010
        int hs_client_keyex_rc;
1011
        int hs_server_keyex_modulus;
1012
        int hs_server_keyex_exponent;
1013
        int hs_server_keyex_sig;
1014
        int hs_server_keyex_hint_len;
1015
        int hs_server_keyex_hint;
1016
        int hs_client_keyex_identity_len;
1017
        int hs_client_keyex_identity;
1018
        int hs_certificates_len;
1019
        int hs_certificates;
1020
        int hs_certificate_len;
1021
        int hs_certificate;
1022
        int hs_cert_types_count;
1023
        int hs_cert_types;
1024
        int hs_cert_type;
1025
        int hs_dnames_len;
1026
        int hs_dnames;
1027
        int hs_dnames_truncated;
1028
        int hs_dname_len;
1029
        int hs_dname;
1030
        int hs_random;
1031
        int hs_random_time;
1032
        int hs_random_bytes;
1033
        int hs_session_id;
1034
        int hs_session_id_len;
1035
        int hs_client_version;
1036
        int hs_server_version;
1037
        int hs_cipher_suites_len;
1038
        int hs_cipher_suites;
1039
        int hs_cipher_suite;
1040
        int hs_comp_methods_len;
1041
        int hs_comp_methods;
1042
        int hs_comp_method;
1043
        int hs_session_ticket_lifetime_hint;
1044
        int hs_session_ticket_age_add;
1045
        int hs_session_ticket_nonce_len;
1046
        int hs_session_ticket_nonce;
1047
        int hs_session_ticket_len;
1048
        int hs_session_ticket;
1049
        int hs_finished;
1050
        int hs_client_cert_vrfy_sig_len;
1051
        int hs_client_cert_vrfy_sig;
1052
        int hs_ja3_full;
1053
        int hs_ja3_hash;
1054
        int hs_ja3s_full;
1055
        int hs_ja3s_hash;
1056
        int hs_ja4;
1057
        int hs_ja4_r;
1058
1059
        /* TLS 1.3 */
1060
        int hs_ext_psk_ke_modes_length;
1061
        int hs_ext_psk_ke_mode;
1062
        int hs_certificate_request_context_length;
1063
        int hs_certificate_request_context;
1064
        int hs_key_update_request_update;
1065
        int sct_scts_length;
1066
        int sct_sct_length;
1067
        int sct_sct_version;
1068
        int sct_sct_logid;
1069
        int sct_sct_timestamp;
1070
        int sct_sct_extensions_length;
1071
        int sct_sct_extensions;
1072
        int sct_sct_signature;
1073
        int sct_sct_signature_length;
1074
        int hs_ext_max_early_data_size;
1075
        int hs_ext_oid_filters_length;
1076
        int hs_ext_oid_filters_oid_length;
1077
        int hs_ext_oid_filters_oid;
1078
        int hs_ext_oid_filters_values_length;
1079
        int hs_cred_valid_time;
1080
        int hs_cred_pubkey;
1081
        int hs_cred_pubkey_len;
1082
        int hs_cred_signature;
1083
        int hs_cred_signature_len;
1084
1085
        /* compress_certificate */
1086
        int hs_ext_compress_certificate_algorithms_length;
1087
        int hs_ext_compress_certificate_algorithm;
1088
        int hs_ext_compress_certificate_uncompressed_length;
1089
        int hs_ext_compress_certificate_compressed_certificate_message_length;
1090
        int hs_ext_compress_certificate_compressed_certificate_message;
1091
1092
        /* Token Binding Negotiation */
1093
        int hs_ext_token_binding_version_major;
1094
        int hs_ext_token_binding_version_minor;
1095
        int hs_ext_token_binding_key_parameters;
1096
        int hs_ext_token_binding_key_parameters_length;
1097
        int hs_ext_token_binding_key_parameter;
1098
1099
        int hs_ext_record_size_limit;
1100
1101
        /* QUIC Transport Parameters */
1102
        int hs_ext_quictp_len;
1103
        int hs_ext_quictp_parameter;
1104
        int hs_ext_quictp_parameter_type;
1105
        int hs_ext_quictp_parameter_len;
1106
        int hs_ext_quictp_parameter_len_old;
1107
        int hs_ext_quictp_parameter_value;
1108
        int hs_ext_quictp_parameter_original_destination_connection_id;
1109
        int hs_ext_quictp_parameter_max_idle_timeout;
1110
        int hs_ext_quictp_parameter_stateless_reset_token;
1111
        int hs_ext_quictp_parameter_initial_max_data;
1112
        int hs_ext_quictp_parameter_initial_max_stream_data_bidi_local;
1113
        int hs_ext_quictp_parameter_initial_max_stream_data_bidi_remote;
1114
        int hs_ext_quictp_parameter_initial_max_stream_data_uni;
1115
        int hs_ext_quictp_parameter_initial_max_streams_bidi;
1116
        int hs_ext_quictp_parameter_initial_max_streams_uni;
1117
        int hs_ext_quictp_parameter_ack_delay_exponent;
1118
        int hs_ext_quictp_parameter_max_ack_delay;
1119
        int hs_ext_quictp_parameter_max_udp_payload_size;
1120
        int hs_ext_quictp_parameter_pa_ipv4address;
1121
        int hs_ext_quictp_parameter_pa_ipv6address;
1122
        int hs_ext_quictp_parameter_pa_ipv4port;
1123
        int hs_ext_quictp_parameter_pa_ipv6port;
1124
        int hs_ext_quictp_parameter_pa_connectionid_length;
1125
        int hs_ext_quictp_parameter_pa_connectionid;
1126
        int hs_ext_quictp_parameter_pa_statelessresettoken;
1127
        int hs_ext_quictp_parameter_active_connection_id_limit;
1128
        int hs_ext_quictp_parameter_initial_source_connection_id;
1129
        int hs_ext_quictp_parameter_retry_source_connection_id;
1130
        int hs_ext_quictp_parameter_max_datagram_frame_size;
1131
        int hs_ext_quictp_parameter_cibir_encoding_length;
1132
        int hs_ext_quictp_parameter_cibir_encoding_offset;
1133
        int hs_ext_quictp_parameter_loss_bits;
1134
        int hs_ext_quictp_parameter_address_discovery;
1135
        int hs_ext_quictp_parameter_enable_time_stamp_v2;
1136
        int hs_ext_quictp_parameter_min_ack_delay;
1137
        int hs_ext_quictp_parameter_google_user_agent_id;
1138
        int hs_ext_quictp_parameter_google_key_update_not_yet_supported;
1139
        int hs_ext_quictp_parameter_google_quic_version;
1140
        int hs_ext_quictp_parameter_google_initial_rtt;
1141
        int hs_ext_quictp_parameter_google_support_handshake_done;
1142
        int hs_ext_quictp_parameter_google_quic_params;
1143
        int hs_ext_quictp_parameter_google_quic_params_unknown_field;
1144
        int hs_ext_quictp_parameter_google_connection_options;
1145
        int hs_ext_quictp_parameter_google_supported_versions_length;
1146
        int hs_ext_quictp_parameter_google_supported_version;
1147
        int hs_ext_quictp_parameter_facebook_partial_reliability;
1148
        int hs_ext_quictp_parameter_chosen_version;
1149
        int hs_ext_quictp_parameter_other_version;
1150
        int hs_ext_quictp_parameter_enable_multipath;
1151
        int hs_ext_quictp_parameter_initial_max_paths;
1152
        int hs_ext_quictp_parameter_initial_max_path_id;
1153
1154
        int esni_suite;
1155
        int esni_record_digest_length;
1156
        int esni_record_digest;
1157
        int esni_encrypted_sni_length;
1158
        int esni_encrypted_sni;
1159
        int esni_nonce;
1160
1161
        int ech_echconfiglist_length;
1162
        int ech_echconfiglist;
1163
        int ech_echconfig;
1164
        int ech_echconfig_version;
1165
        int ech_echconfig_length;
1166
        int ech_echconfigcontents_maximum_name_length;
1167
        int ech_echconfigcontents_public_name_length;
1168
        int ech_echconfigcontents_public_name;
1169
        int ech_echconfigcontents_extensions_length;
1170
        int ech_echconfigcontents_extensions;
1171
        int ech_hpke_keyconfig;
1172
        int ech_hpke_keyconfig_config_id;
1173
        int ech_hpke_keyconfig_kem_id;
1174
        int ech_hpke_keyconfig_public_key_length;
1175
        int ech_hpke_keyconfig_public_key;
1176
        int ech_hpke_keyconfig_cipher_suites;
1177
        int ech_hpke_keyconfig_cipher_suites_length;
1178
        int ech_hpke_keyconfig_cipher_suite;
1179
        int ech_hpke_keyconfig_cipher_suite_kdf_id;
1180
        int ech_hpke_keyconfig_cipher_suite_aead_id;
1181
        int ech_clienthello_type;
1182
        int ech_cipher_suite;
1183
        int ech_config_id;
1184
        int ech_enc_length;
1185
        int ech_enc;
1186
        int ech_payload_length;
1187
        int ech_payload;
1188
        int ech_confirmation;
1189
        int ech_retry_configs;
1190
        int ech_padding_data;
1191
1192
        int hs_ext_alps_len;
1193
        int hs_ext_alps_alpn_list;
1194
        int hs_ext_alps_alpn_str;
1195
        int hs_ext_alps_alpn_str_len;
1196
        int hs_ext_alps_settings;
1197
1198
        /* do not forget to update SSL_COMMON_HF_LIST! */
1199
    } hf;
1200
    struct {
1201
        int hs_ext;
1202
        int hs_ext_alpn;
1203
        int hs_ext_cert_types;
1204
        int hs_ext_groups;
1205
        int hs_ext_curves_point_formats;
1206
        int hs_ext_npn;
1207
        int hs_ext_reneg_info;
1208
        int hs_ext_key_share;
1209
        int hs_ext_key_share_ks;
1210
        int hs_ext_pre_shared_key;
1211
        int hs_ext_psk_identity;
1212
        int hs_ext_psk_binders;
1213
        int hs_ext_psk_binder;
1214
        int hs_ext_server_name;
1215
        int hs_ext_oid_filter;
1216
        int hs_ext_quictp_parameter;
1217
        int hs_ext_trusted_ca_keys;
1218
        int hs_ext_trusted_ca_key;
1219
        int hs_sig_hash_alg;
1220
        int hs_sig_hash_algs;
1221
        int urlhash;
1222
        int keyex_params;
1223
        int certificates;
1224
        int cert_types;
1225
        int dnames;
1226
        int hs_random;
1227
        int cipher_suites;
1228
        int comp_methods;
1229
        int session_ticket;
1230
        int sct;
1231
        int cert_status;
1232
        int ocsp_response;
1233
        int uncompressed_certificates;
1234
        int hs_ext_alps;
1235
        int ech_echconfiglist;
1236
        int ech_echconfig;
1237
        int ech_retry_configs;
1238
        int ech_hpke_keyconfig;
1239
        int ech_hpke_cipher_suites;
1240
        int ech_hpke_cipher_suite;
1241
        int ech_decrypt;
1242
        int hs_ext_token_binding_key_parameters;
1243
1244
        /* do not forget to update SSL_COMMON_ETT_LIST! */
1245
    } ett;
1246
    struct {
1247
        /* Generic expert info for malformed packets. */
1248
        expert_field client_version_error;
1249
        expert_field server_version_error;
1250
        expert_field legacy_version;
1251
        expert_field malformed_vector_length;
1252
        expert_field malformed_buffer_too_small;
1253
        expert_field malformed_trailing_data;
1254
1255
        expert_field hs_ext_cert_status_undecoded;
1256
        expert_field hs_ciphersuite_undecoded;
1257
        expert_field hs_srv_keyex_illegal;
1258
        expert_field resumed;
1259
        expert_field record_length_invalid;
1260
        expert_field decompression_error;
1261
1262
        expert_field ech_echconfig_invalid_version;
1263
        expert_field ech_accepted;
1264
        expert_field ech_rejected;
1265
1266
        /* do not forget to update SSL_COMMON_EI_LIST! */
1267
    } ei;
1268
} ssl_common_dissect_t;
1269
1270
/* Header fields specific to DTLS. See packet-dtls.c */
1271
typedef struct {
1272
    int hf_dtls_handshake_cookie_len;
1273
    int hf_dtls_handshake_cookie;
1274
1275
    /* Do not forget to initialize dtls_hfs to -1 in packet-dtls.c! */
1276
} dtls_hfs_t;
1277
1278
/* Header fields specific to SSL. See packet-tls.c */
1279
typedef struct {
1280
    int hs_md5_hash;
1281
    int hs_sha_hash;
1282
1283
    /* Do not forget to initialize ssl_hfs to -1 in packet-tls.c! */
1284
} ssl_hfs_t;
1285
1286
typedef struct {
1287
    uint32_t       max_version;
1288
    bool           server_name_present;
1289
    int            num_cipher_suites;
1290
    int            num_extensions;
1291
    wmem_strbuf_t *alpn;
1292
    wmem_list_t   *cipher_list;
1293
    wmem_list_t   *extension_list;
1294
    wmem_list_t   *sighash_list;
1295
} ja4_data_t;
1296
1297
1298
/* Helpers for dissecting Variable-Length Vectors. {{{ */
1299
/* Largest value that fits in a 24-bit number (2^24-1). */
1300
270
#define G_MAXUINT24     ((1U << 24) - 1)
1301
1302
/**
1303
 * Helper for dissection of variable-length vectors (RFC 5246, section 4.3). It
1304
 * adds a length field to the tree and writes the validated length value into
1305
 * "ret_length" (which is truncated if it exceeds "offset_end").
1306
 *
1307
 * The size of the field is derived from "max_value" (for example, 8 and 255
1308
 * require one byte while 400 needs two bytes). Expert info is added if the
1309
 * length field from the tvb is outside the (min_value, max_value) range.
1310
 *
1311
 * Returns true if there is enough space for the length field and data elements
1312
 * and false otherwise.
1313
 */
1314
extern bool
1315
ssl_add_vector(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1316
               unsigned offset, unsigned offset_end, uint32_t *ret_length,
1317
               int hf_length, uint32_t min_value, uint32_t max_value);
1318
1319
/**
1320
 * Helper to check whether the data in a vector with multiple elements is
1321
 * correctly dissected. If the current "offset" (normally the value after
1322
 * adding all kinds of fields) does not match "offset_end" (the end of the
1323
 * vector), expert info is added.
1324
 *
1325
 * Returns true if the offset matches the end of the vector and false otherwise.
1326
 */
1327
extern bool
1328
ssl_end_vector(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1329
               unsigned offset, unsigned offset_end);
1330
/* }}} */
1331
1332
1333
extern void
1334
ssl_check_record_length(ssl_common_dissect_t *hf, packet_info *pinfo,
1335
                        ContentType content_type,
1336
                        unsigned record_length, proto_item *length_pi,
1337
                        uint16_t version, tvbuff_t *decrypted_tvb);
1338
1339
void
1340
ssl_dissect_change_cipher_spec(ssl_common_dissect_t *hf, tvbuff_t *tvb,
1341
                               packet_info *pinfo, proto_tree *tree,
1342
                               uint32_t offset, SslSession *session,
1343
                               bool is_from_server,
1344
                               const SslDecryptSession *ssl);
1345
1346
extern int
1347
ssl_dissect_hnd_cli_hello(ssl_common_dissect_t *hf, tvbuff_t *tvb,
1348
                          packet_info *pinfo, proto_tree *tree, uint32_t offset,
1349
                          uint32_t offset_end, SslSession *session,
1350
                          SslDecryptSession *ssl,
1351
                          dtls_hfs_t *dtls_hfs, ssl_master_key_map_t *mk_map);
1352
1353
extern void
1354
ssl_dissect_hnd_srv_hello(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info* pinfo,
1355
                          proto_tree *tree, uint32_t offset, uint32_t offset_end,
1356
                          SslSession *session, SslDecryptSession *ssl,
1357
                          bool is_dtls, bool is_hrr);
1358
1359
extern void
1360
ssl_dissect_hnd_hello_retry_request(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info* pinfo,
1361
                                    proto_tree *tree, uint32_t offset, uint32_t offset_end,
1362
                                    SslSession *session, SslDecryptSession *ssl,
1363
                                    bool is_dtls);
1364
1365
extern void
1366
ssl_dissect_hnd_encrypted_extensions(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info* pinfo,
1367
                                     proto_tree *tree, uint32_t offset, uint32_t offset_end,
1368
                                     SslSession *session, SslDecryptSession *ssl,
1369
                                     bool is_dtls);
1370
1371
extern void
1372
ssl_dissect_hnd_new_ses_ticket(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info *pinfo,
1373
                               proto_tree *tree, uint32_t offset, uint32_t offset_end,
1374
                               SslSession *session, SslDecryptSession *ssl,
1375
                               bool is_dtls, GHashTable *session_hash);
1376
1377
extern void
1378
ssl_dissect_hnd_cert(ssl_common_dissect_t *hf, tvbuff_t *tvb, proto_tree *tree,
1379
                     uint32_t offset, uint32_t offset_end, packet_info *pinfo,
1380
                     SslSession *session, SslDecryptSession *ssl,
1381
                     bool is_from_server, bool is_dtls);
1382
1383
extern void
1384
ssl_dissect_hnd_cert_req(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info *pinfo,
1385
                         proto_tree *tree, uint32_t offset, uint32_t offset_end,
1386
                         SslSession *session, bool is_dtls);
1387
1388
extern void
1389
ssl_dissect_hnd_cli_cert_verify(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info *pinfo,
1390
                                proto_tree *tree, uint32_t offset, uint32_t offset_end, uint16_t version);
1391
1392
extern void
1393
ssl_dissect_hnd_finished(ssl_common_dissect_t *hf, tvbuff_t *tvb,
1394
                         proto_tree *tree, uint32_t offset, uint32_t offset_end,
1395
                         const SslSession *session, ssl_hfs_t *ssl_hfs);
1396
1397
extern void
1398
ssl_dissect_hnd_cert_url(ssl_common_dissect_t *hf, tvbuff_t *tvb, proto_tree *tree, uint32_t offset);
1399
1400
extern uint32_t
1401
tls_dissect_hnd_certificate_status(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info *pinfo,
1402
                                   proto_tree *tree, uint32_t offset, uint32_t offset_end);
1403
1404
extern void
1405
ssl_dissect_hnd_cli_keyex(ssl_common_dissect_t *hf, tvbuff_t *tvb,
1406
                          proto_tree *tree, uint32_t offset, uint32_t length,
1407
                          const SslSession *session);
1408
1409
extern void
1410
ssl_dissect_hnd_srv_keyex(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info *pinfo,
1411
                          proto_tree *tree, uint32_t offset, uint32_t offset_end,
1412
                          const SslSession *session);
1413
1414
extern void
1415
tls13_dissect_hnd_key_update(ssl_common_dissect_t *hf, tvbuff_t *tvb,
1416
                             proto_tree *tree, uint32_t offset);
1417
1418
extern uint32_t
1419
tls_dissect_sct_list(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1420
                     uint32_t offset, uint32_t offset_end, uint16_t version);
1421
1422
extern bool
1423
tls13_hkdf_expand_label_context(int md, const StringInfo *secret,
1424
                        const char *label_prefix, const char *label,
1425
                        const uint8_t *context, uint8_t context_length,
1426
                        uint16_t out_len, unsigned char **out);
1427
1428
extern bool
1429
tls13_hkdf_expand_label(int md, const StringInfo *secret,
1430
                        const char *label_prefix, const char *label,
1431
                        uint16_t out_len, unsigned char **out);
1432
1433
extern void
1434
ssl_dissect_hnd_compress_certificate(ssl_common_dissect_t *hf, tvbuff_t *tvb, proto_tree *tree,
1435
                                     uint32_t offset, uint32_t offset_end, packet_info *pinfo,
1436
                                     SslSession *session _U_, SslDecryptSession *ssl _U_,
1437
                                     bool is_from_server _U_, bool is_dtls _U_);
1438
1439
extern tap_packet_status
1440
ssl_follow_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *ssl, tap_flags_t flags _U_);
1441
1442
/* {{{ */
1443
#define SSL_COMMON_LIST_T(name) \
1444
ssl_common_dissect_t name
1445
/* }}} */
1446
1447
/* {{{ */
1448
#define SSL_COMMON_HF_LIST(name, prefix)                                \
1449
30
    { & name .hf.change_cipher_spec,                                    \
1450
30
      { "Change Cipher Spec Message", prefix ".change_cipher_spec",     \
1451
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1452
30
        "Signals a change in cipher specifications", HFILL }            \
1453
30
    },                                                                  \
1454
30
    { & name .hf.hs_exts_len,                                           \
1455
30
      { "Extensions Length", prefix ".handshake.extensions_length",     \
1456
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1457
30
        "Length of hello extensions", HFILL }                           \
1458
30
    },                                                                  \
1459
30
    { & name .hf.hs_ext,                                                \
1460
30
      { "Extension", prefix ".handshake.extension",                     \
1461
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1462
30
        "Hello extension", HFILL }                                      \
1463
30
    },                                                                  \
1464
30
    { & name .hf.hs_ext_type,                                           \
1465
30
      { "Type", prefix ".handshake.extension.type",                     \
1466
30
        FT_UINT16, BASE_DEC, VALS(tls_hello_extension_types), 0x0,      \
1467
30
        "Hello extension type", HFILL }                                 \
1468
30
    },                                                                  \
1469
30
    { & name .hf.hs_ext_len,                                            \
1470
30
      { "Length", prefix ".handshake.extension.len",                    \
1471
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1472
30
        "Length of a hello extension", HFILL }                          \
1473
30
    },                                                                  \
1474
30
    { & name .hf.hs_ext_data,                                           \
1475
30
      { "Data", prefix ".handshake.extension.data",                     \
1476
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1477
30
        "Hello Extension data", HFILL }                                 \
1478
30
    },                                                                  \
1479
30
    { & name .hf.hs_ext_ech_outer_ext_len,                              \
1480
30
      { "Outer Extensions List Length", prefix ".handshake.extensions_ech_outer_extensions_length", \
1481
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1482
30
        NULL, HFILL }                                                   \
1483
30
    },                                                                  \
1484
30
    { & name .hf.hs_ext_ech_outer_ext,                                  \
1485
30
      { "Outer Extensions List", prefix ".handshake.extensions_ech_outer_extensions", \
1486
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1487
30
        "List of extensions derived from Outer Client Hello", HFILL }   \
1488
30
    },                                                                  \
1489
30
    { & name .hf.hs_ech_confirm,                                        \
1490
30
      { "ECH Confirmation Bytes", prefix ".handshake.ech_confirm",      \
1491
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                  \
1492
30
        NULL, HFILL }                                                   \
1493
30
    },                                                                  \
1494
30
    { & name .hf.hs_ech_confirm_compute,                                \
1495
30
      { "Computed ECH Confirmation Bytes", prefix ".handshake.ech_confirm_compute", \
1496
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                \
1497
30
        NULL, HFILL }                                                   \
1498
30
    },                                                                  \
1499
30
    { & name .hf.hs_ext_supported_groups_len,                           \
1500
30
      { "Supported Groups List Length", prefix ".handshake.extensions_supported_groups_length", \
1501
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1502
30
        NULL, HFILL }                                                   \
1503
30
    },                                                                  \
1504
30
    { & name .hf.hs_ext_supported_groups,                               \
1505
30
      { "Supported Groups List", prefix ".handshake.extensions_supported_groups", \
1506
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1507
30
        "List of supported groups (formerly Supported Elliptic Curves)", HFILL } \
1508
30
    },                                                                  \
1509
30
    { & name .hf.hs_ext_supported_group,                                \
1510
30
      { "Supported Group", prefix ".handshake.extensions_supported_group", \
1511
30
        FT_UINT16, BASE_HEX, VALS(ssl_extension_curves), 0x0,           \
1512
30
        NULL, HFILL }                                                   \
1513
30
    },                                                                  \
1514
30
    { & name .hf.hs_ext_ec_point_formats_len,                           \
1515
30
      { "EC point formats Length", prefix ".handshake.extensions_ec_point_formats_length",     \
1516
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1517
30
        "Length of elliptic curves point formats field", HFILL }        \
1518
30
    },                                                                  \
1519
30
    { & name .hf.hs_ext_ec_point_formats,                               \
1520
30
      { "EC point formats", prefix ".handshake.extensions_ec_point_formats", \
1521
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1522
30
        "List of elliptic curves point format", HFILL }                 \
1523
30
    },                                                                  \
1524
30
    { & name .hf.hs_ext_ec_point_format,                                \
1525
30
      { "EC point format", prefix ".handshake.extensions_ec_point_format",             \
1526
30
        FT_UINT8, BASE_DEC, VALS(ssl_extension_ec_point_formats), 0x0,  \
1527
30
        "Elliptic curves point format", HFILL }                         \
1528
30
    },                                                                  \
1529
30
    { & name .hf.hs_ext_srp_len,                                        \
1530
30
      { "SRP username length", prefix ".handshake.extensions_srp_len",  \
1531
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1532
30
        "Length of Secure Remote Password username field", HFILL }      \
1533
30
    },                                                                  \
1534
30
    { & name .hf.hs_ext_srp_username,                                   \
1535
30
      { "SRP username", prefix ".handshake.extensions_srp_username",    \
1536
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
1537
30
        "Secure Remote Password username", HFILL }                      \
1538
30
    },                                                                  \
1539
30
    { & name .hf.hs_ext_alpn_len,                                       \
1540
30
      { "ALPN Extension Length", prefix ".handshake.extensions_alpn_len",              \
1541
30
      FT_UINT16, BASE_DEC, NULL, 0x0,                                   \
1542
30
      "Length of the ALPN Extension", HFILL }                           \
1543
30
    },                                                                  \
1544
30
    { & name .hf.hs_ext_alpn_list,                                      \
1545
30
      { "ALPN Protocol", prefix ".handshake.extensions_alpn_list",      \
1546
30
      FT_NONE, BASE_NONE, NULL, 0x0,                                    \
1547
30
      NULL, HFILL }                                                     \
1548
30
    },                                                                  \
1549
30
    { & name .hf.hs_ext_alpn_str_len,                                   \
1550
30
      { "ALPN string length", prefix ".handshake.extensions_alpn_str_len",             \
1551
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1552
30
        "Length of ALPN string", HFILL }                                \
1553
30
    },                                                                  \
1554
30
    { & name .hf.hs_ext_alpn_str,                                       \
1555
30
      { "ALPN Next Protocol", prefix ".handshake.extensions_alpn_str",  \
1556
30
        FT_STRING, BASE_NONE, NULL, 0x00,                               \
1557
30
        NULL, HFILL }                                                   \
1558
30
    },                                                                  \
1559
30
    { & name .hf.hs_ext_npn_str_len,                                    \
1560
30
      { "Protocol string length", prefix ".handshake.extensions_npn_str_len",          \
1561
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1562
30
        "Length of next protocol string", HFILL }                       \
1563
30
    },                                                                  \
1564
30
    { & name .hf.hs_ext_npn_str,                                        \
1565
30
      { "Next Protocol", prefix ".handshake.extensions_npn",            \
1566
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
1567
30
        NULL, HFILL }                                                   \
1568
30
    },                                                                  \
1569
30
    { & name .hf.hs_ext_reneg_info_len,                                 \
1570
30
      { "Renegotiation info extension length", prefix ".handshake.extensions_reneg_info_len",  \
1571
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1572
30
        NULL, HFILL }                                                   \
1573
30
    },                                                                  \
1574
30
    { & name .hf.hs_ext_reneg_info,                                     \
1575
30
      { "Renegotiation info", prefix ".handshake.extensions_reneg_info",\
1576
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1577
30
        NULL, HFILL }                                                   \
1578
30
    },                                                                  \
1579
30
    { & name .hf.hs_ext_key_share_client_length,                        \
1580
30
      { "Client Key Share Length", prefix ".handshake.extensions_key_share_client_length",  \
1581
30
         FT_UINT16, BASE_DEC, NULL, 0x00,                               \
1582
30
         NULL, HFILL }                                                  \
1583
30
    },                                                                  \
1584
30
    { & name .hf.hs_ext_key_share_group,                                \
1585
30
      { "Group", prefix ".handshake.extensions_key_share_group",        \
1586
30
         FT_UINT16, BASE_DEC, VALS(ssl_extension_curves), 0x00,         \
1587
30
         NULL, HFILL }                                                  \
1588
30
    },                                                                  \
1589
30
    { & name .hf.hs_ext_key_share_key_exchange_length,                  \
1590
30
      { "Key Exchange Length", prefix ".handshake.extensions_key_share_key_exchange_length",   \
1591
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
1592
30
        NULL, HFILL }                                                   \
1593
30
    },                                                                  \
1594
30
    { & name .hf.hs_ext_key_share_key_exchange,                         \
1595
30
      { "Key Exchange", prefix ".handshake.extensions_key_share_key_exchange",  \
1596
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1597
30
        NULL, HFILL }                                                   \
1598
30
    },                                                                  \
1599
30
    { & name .hf.hs_ext_key_share_selected_group,                       \
1600
30
      { "Selected Group", prefix ".handshake.extensions_key_share_selected_group",  \
1601
30
         FT_UINT16, BASE_DEC, VALS(ssl_extension_curves), 0x00,         \
1602
30
         NULL, HFILL }                                                  \
1603
30
    },                                                                  \
1604
30
    { & name .hf.hs_ext_psk_identities_length,                          \
1605
30
      { "Identities Length", prefix ".handshake.extensions.psk.identities.length",  \
1606
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1607
30
        NULL, HFILL }                                                   \
1608
30
    },                                                                  \
1609
30
    { & name .hf.hs_ext_psk_identity_identity_length,                   \
1610
30
      { "Identity Length", prefix ".handshake.extensions.psk.identity.identity_length", \
1611
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1612
30
        NULL, HFILL }                                                   \
1613
30
    },                                                                  \
1614
30
    { & name .hf.hs_ext_psk_identity_identity,                          \
1615
30
      { "Identity", prefix ".handshake.extensions.psk.identity.identity", \
1616
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1617
30
        NULL, HFILL }                                                   \
1618
30
    },                                                                  \
1619
30
    { & name .hf.hs_ext_psk_identity_obfuscated_ticket_age,             \
1620
30
      { "Obfuscated Ticket Age", prefix ".handshake.extensions.psk.identity.obfuscated_ticket_age", \
1621
30
        FT_UINT32, BASE_DEC, NULL, 0x0,                                 \
1622
30
        NULL, HFILL }                                                   \
1623
30
    },                                                                  \
1624
30
    { & name .hf.hs_ext_psk_binders_length,                             \
1625
30
      { "PSK Binders length", prefix ".handshake.extensions.psk.binders_len", \
1626
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1627
30
        NULL, HFILL }                                                   \
1628
30
    },                                                                  \
1629
30
    { & name .hf.hs_ext_psk_binders,                                    \
1630
30
      { "PSK Binders", prefix ".handshake.extensions.psk.binders",      \
1631
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1632
30
        NULL, HFILL }                                                   \
1633
30
    },                                                                  \
1634
30
    { & name .hf.hs_ext_psk_binder,                                     \
1635
30
      { "PSK Binder", prefix ".handshake.extensions.psk.binder",        \
1636
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1637
30
        NULL, HFILL }                                                   \
1638
30
    },                                                                  \
1639
30
    { & name .hf.hs_ext_psk_binder_binder_length,                       \
1640
30
      { "Binder Length", prefix ".handshake.extensions.psk.binder.binder_length", \
1641
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1642
30
        NULL, HFILL }                                                   \
1643
30
    },                                                                  \
1644
30
    { & name .hf.hs_ext_psk_binder_binder,                              \
1645
30
      { "Binder", prefix ".handshake.extensions.psk.binder.binder",     \
1646
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1647
30
        NULL, HFILL }                                                   \
1648
30
    },                                                                  \
1649
30
    { & name .hf.hs_ext_psk_identity_selected,                          \
1650
30
      { "Selected Identity", prefix ".handshake.extensions.psk.identity.selected", \
1651
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1652
30
        NULL, HFILL }                                                   \
1653
30
    },                                                                  \
1654
30
    { & name .hf.hs_ext_session_ticket,                                 \
1655
30
      { "Session Ticket", prefix ".handshake.extensions.session_ticket", \
1656
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1657
30
        NULL, HFILL }                                                   \
1658
30
    },                                                                  \
1659
30
    { & name .hf.hs_ext_supported_versions_len,                         \
1660
30
      { "Supported Versions length", prefix ".handshake.extensions.supported_versions_len", \
1661
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1662
30
        NULL, HFILL }                                                   \
1663
30
    },                                                                  \
1664
30
    { & name .hf.hs_ext_supported_version,                              \
1665
30
      { "Supported Version", prefix ".handshake.extensions.supported_version", \
1666
30
        FT_UINT16, BASE_HEX, VALS(ssl_versions), 0x0,                   \
1667
30
        NULL, HFILL }                                                   \
1668
30
    },                                                                  \
1669
30
    { & name .hf.hs_ext_cookie_len,                                     \
1670
30
      { "Cookie length", prefix ".handshake.extensions.cookie_len",     \
1671
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1672
30
        NULL, HFILL }                                                   \
1673
30
    },                                                                  \
1674
30
    { & name .hf.hs_ext_cookie,                                         \
1675
30
      { "Cookie", prefix ".handshake.extensions.cookie",                \
1676
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1677
30
        NULL, HFILL }                                                   \
1678
30
    },                                                                  \
1679
30
    { & name .hf.hs_ext_server_name_list_len,                           \
1680
30
      { "Server Name list length", prefix ".handshake.extensions_server_name_list_len",    \
1681
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1682
30
        "Length of server name list", HFILL }                           \
1683
30
    },                                                                  \
1684
30
    { & name .hf.hs_ext_server_name_len,                                \
1685
30
      { "Server Name length", prefix ".handshake.extensions_server_name_len",          \
1686
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1687
30
        "Length of server name string", HFILL }                         \
1688
30
    },                                                                  \
1689
30
    { & name .hf.hs_ext_server_name_type,                               \
1690
30
      { "Server Name Type", prefix ".handshake.extensions_server_name_type",           \
1691
30
        FT_UINT8, BASE_DEC, VALS(tls_hello_ext_server_name_type_vs), 0x0,               \
1692
30
        NULL, HFILL }                                                   \
1693
30
    },                                                                  \
1694
30
    { & name .hf.hs_ext_server_name,                                    \
1695
30
      { "Server Name", prefix ".handshake.extensions_server_name",      \
1696
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
1697
30
        NULL, HFILL }                                                   \
1698
30
    },                                                                  \
1699
30
    { & name .hf.hs_ext_max_fragment_length,                            \
1700
30
      { "Maximum Fragment Length", prefix ".handshake.max_fragment_length", \
1701
30
        FT_UINT8, BASE_DEC, VALS(tls_hello_ext_max_fragment_length), 0x00, \
1702
30
        "Maximum fragment length that an endpoint is willing to receive", HFILL } \
1703
30
    },                                                                  \
1704
30
    { & name .hf.hs_ext_padding_data,                                   \
1705
30
      { "Padding Data", prefix ".handshake.extensions_padding_data",    \
1706
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1707
30
        "Must be zero", HFILL }                                         \
1708
30
    },                                                                  \
1709
30
    { & name .hf.hs_ext_cert_url_type,                                  \
1710
30
      { "Certificate Chain Type", prefix ".handshake.cert_url_type",    \
1711
30
        FT_UINT8, BASE_DEC, VALS(tls_cert_chain_type), 0x0,             \
1712
30
        "Certificate Chain Type for Client Certificate URL", HFILL }    \
1713
30
    },                                                                  \
1714
30
    { & name .hf.hs_ext_cert_url_url_hash_list_len,                     \
1715
30
      { "URL and Hash list Length", prefix ".handshake.cert_url.url_hash_len",         \
1716
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1717
30
        NULL, HFILL }                                                   \
1718
30
    },                                                                  \
1719
30
    { & name .hf.hs_ext_cert_url_item,                                  \
1720
30
      { "URL and Hash", prefix ".handshake.cert_url.url_hash",          \
1721
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1722
30
        NULL, HFILL }                                                   \
1723
30
    },                                                                  \
1724
30
    { & name .hf.hs_ext_cert_url_url_len,                               \
1725
30
      { "URL Length", prefix ".handshake.cert_url.url_len",             \
1726
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1727
30
        NULL, HFILL }                                                   \
1728
30
    },                                                                  \
1729
30
    { & name .hf.hs_ext_cert_type,                                      \
1730
30
      { "Certificate Type", prefix ".handshake.cert_type.type",         \
1731
30
        FT_UINT8, BASE_HEX, VALS(tls_certificate_type), 0x0,            \
1732
30
        NULL, HFILL }                                                   \
1733
30
    },                                                                  \
1734
30
    { & name .hf.hs_ext_cert_types,                                     \
1735
30
      { "Certificate Type List", prefix ".handshake.cert_type.types",   \
1736
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1737
30
        NULL, HFILL }                                                   \
1738
30
    },                                                                  \
1739
30
    { & name .hf.hs_ext_cert_types_len,                                 \
1740
30
      { "Certificate Type List Length", prefix ".handshake.cert_type.types_len",       \
1741
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1742
30
        NULL, HFILL }                                                   \
1743
30
    },                                                                  \
1744
30
    { & name .hf.hs_ext_cert_url_url,                                   \
1745
30
      { "URL", prefix ".handshake.cert_url.url",                        \
1746
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
1747
30
        "URL used to fetch the certificate(s)", HFILL }                 \
1748
30
    },                                                                  \
1749
30
    { & name .hf.hs_ext_cert_url_padding,                               \
1750
30
      { "Padding", prefix ".handshake.cert_url.padding",                \
1751
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1752
30
        "Padding that MUST be 0x01 for backwards compatibility", HFILL }                \
1753
30
    },                                                                  \
1754
30
    { & name .hf.hs_ext_cert_url_sha1,                                  \
1755
30
      { "SHA1 Hash", prefix ".handshake.cert_url.sha1",                 \
1756
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1757
30
        "SHA1 Hash of the certificate", HFILL }                         \
1758
30
    },                                                                  \
1759
30
    { & name .hf.hs_ext_cert_status_type,                               \
1760
30
      { "Certificate Status Type", prefix ".handshake.extensions_status_request_type", \
1761
30
        FT_UINT8, BASE_DEC, VALS(tls_cert_status_type), 0x0,            \
1762
30
        NULL, HFILL }                                                   \
1763
30
    },                                                                  \
1764
30
    { & name .hf.hs_ext_cert_status_request_len,                        \
1765
30
      { "Certificate Status Length", prefix ".handshake.extensions_status_request_len",    \
1766
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1767
30
        NULL, HFILL }                                                   \
1768
30
    },                                                                  \
1769
30
    { & name .hf.hs_ext_cert_status_responder_id_list_len,              \
1770
30
      { "Responder ID list Length", prefix ".handshake.extensions_status_request_responder_ids_len",   \
1771
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1772
30
        NULL, HFILL }                                                   \
1773
30
    },                                                                  \
1774
30
    { & name .hf.hs_ext_cert_status_request_extensions_len,             \
1775
30
      { "Request Extensions Length", prefix ".handshake.extensions_status_request_exts_len",   \
1776
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1777
30
        NULL, HFILL }                                                   \
1778
30
    },                                                                  \
1779
30
    { & name .hf.hs_ext_cert_status_request_list_len,                   \
1780
30
      { "Certificate Status List Length", prefix ".handshake.extensions_status_request_list_len", \
1781
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1782
30
        "CertificateStatusRequestItemV2 list length", HFILL }           \
1783
30
    },                                                                  \
1784
30
    { & name .hf.hs_ocsp_response_list_len,                             \
1785
30
      { "OCSP Response List Length", prefix ".handshake.ocsp_response_list_len", \
1786
30
        FT_UINT24, BASE_DEC, NULL, 0x0,                                 \
1787
30
        "OCSPResponseList length", HFILL }                              \
1788
30
    },                                                                  \
1789
30
    { & name .hf.hs_ocsp_response_len,                                  \
1790
30
      { "OCSP Response Length", prefix ".handshake.ocsp_response_len",  \
1791
30
        FT_UINT24, BASE_DEC, NULL, 0x0,                                 \
1792
30
        NULL, HFILL }                                                   \
1793
30
    },                                                                  \
1794
30
    { & name .hf.hs_sig_hash_alg_len,                                   \
1795
30
      { "Signature Hash Algorithms Length", prefix ".handshake.sig_hash_alg_len",      \
1796
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1797
30
        "Length of Signature Hash Algorithms", HFILL }                  \
1798
30
    },                                                                  \
1799
30
    { & name .hf.hs_sig_hash_algs,                                      \
1800
30
      { "Signature Algorithms", prefix ".handshake.sig_hash_algs",      \
1801
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
1802
30
        "List of supported Signature Algorithms", HFILL }               \
1803
30
    },                                                                  \
1804
30
    { & name .hf.hs_sig_hash_alg,                                       \
1805
30
      { "Signature Algorithm", prefix ".handshake.sig_hash_alg",        \
1806
30
        FT_UINT16, BASE_HEX, VALS(tls13_signature_algorithm), 0x0,      \
1807
30
        NULL, HFILL }                                                   \
1808
30
    },                                                                  \
1809
30
    { & name .hf.hs_sig_hash_hash,                                      \
1810
30
      { "Signature Hash Algorithm Hash", prefix ".handshake.sig_hash_hash",            \
1811
30
        FT_UINT8, BASE_DEC, VALS(tls_hash_algorithm), 0x0,              \
1812
30
        "Hash algorithm (TLS 1.2)", HFILL }                             \
1813
30
    },                                                                  \
1814
30
    { & name .hf.hs_sig_hash_sig,                                       \
1815
30
      { "Signature Hash Algorithm Signature", prefix ".handshake.sig_hash_sig",        \
1816
30
        FT_UINT8, BASE_DEC, VALS(tls_signature_algorithm), 0x0,         \
1817
30
        "Signature algorithm (TLS 1.2)", HFILL }                        \
1818
30
    },                                                                  \
1819
30
    { & name .hf.hs_client_keyex_epms_len,                              \
1820
30
      { "Encrypted PreMaster length", prefix ".handshake.epms_len",     \
1821
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1822
30
        "Length of encrypted PreMaster secret", HFILL }                 \
1823
30
    },                                                                  \
1824
30
    { & name .hf.hs_client_keyex_epms,                                  \
1825
30
      { "Encrypted PreMaster", prefix ".handshake.epms",                \
1826
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1827
30
        "Encrypted PreMaster secret", HFILL }                           \
1828
30
    },                                                                  \
1829
30
    { & name .hf.hs_server_keyex_modulus_len,                           \
1830
30
      { "Modulus Length", prefix ".handshake.modulus_len",              \
1831
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1832
30
        "Length of RSA-EXPORT modulus", HFILL }                         \
1833
30
    },                                                                  \
1834
30
    { & name .hf.hs_server_keyex_exponent_len,                          \
1835
30
      { "Exponent Length", prefix ".handshake.exponent_len",            \
1836
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1837
30
        "Length of RSA-EXPORT exponent", HFILL }                        \
1838
30
    },                                                                  \
1839
30
    { & name .hf.hs_server_keyex_sig_len,                               \
1840
30
      { "Signature Length", prefix ".handshake.sig_len",                \
1841
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1842
30
        "Length of Signature", HFILL }                                  \
1843
30
    },                                                                  \
1844
30
    { & name .hf.hs_server_keyex_p_len,                                 \
1845
30
      { "p Length", prefix ".handshake.p_len",                          \
1846
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1847
30
        "Length of p", HFILL }                                          \
1848
30
    },                                                                  \
1849
30
    { & name .hf.hs_server_keyex_g_len,                                 \
1850
30
      { "g Length", prefix ".handshake.g_len",                          \
1851
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1852
30
        "Length of g", HFILL }                                          \
1853
30
    },                                                                  \
1854
30
    { & name .hf.hs_server_keyex_ys_len,                                \
1855
30
      { "Pubkey Length", prefix ".handshake.ys_len",                    \
1856
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1857
30
        "Length of server's Diffie-Hellman public key", HFILL }         \
1858
30
    },                                                                  \
1859
30
    { & name .hf.hs_client_keyex_yc_len,                                \
1860
30
      { "Pubkey Length", prefix ".handshake.yc_len",                    \
1861
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1862
30
        "Length of client's Diffie-Hellman public key", HFILL }         \
1863
30
    },                                                                  \
1864
30
    { & name .hf.hs_client_keyex_point_len,                             \
1865
30
      { "Pubkey Length", prefix ".handshake.client_point_len",          \
1866
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1867
30
        "Length of client's EC Diffie-Hellman public key", HFILL }      \
1868
30
    },                                                                  \
1869
30
    { & name .hf.hs_server_keyex_point_len,                             \
1870
30
      { "Pubkey Length", prefix ".handshake.server_point_len",          \
1871
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1872
30
        "Length of server's EC Diffie-Hellman public key", HFILL }      \
1873
30
    },                                                                  \
1874
30
    { & name .hf.hs_server_keyex_p,                                     \
1875
30
      { "p", prefix ".handshake.p",                                     \
1876
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1877
30
        "Diffie-Hellman p", HFILL }                                     \
1878
30
    },                                                                  \
1879
30
    { & name .hf.hs_server_keyex_g,                                     \
1880
30
      { "g", prefix ".handshake.g",                                     \
1881
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1882
30
        "Diffie-Hellman g", HFILL }                                     \
1883
30
    },                                                                  \
1884
30
    { & name .hf.hs_server_keyex_curve_type,                            \
1885
30
      { "Curve Type", prefix ".handshake.server_curve_type",            \
1886
30
        FT_UINT8, BASE_HEX, VALS(ssl_curve_types), 0x0,                 \
1887
30
        "Server curve_type", HFILL }                                    \
1888
30
    },                                                                  \
1889
30
    { & name .hf.hs_server_keyex_named_curve,                           \
1890
30
      { "Named Curve", prefix ".handshake.server_named_curve",          \
1891
30
        FT_UINT16, BASE_HEX, VALS(ssl_extension_curves), 0x0,           \
1892
30
        "Server named_curve", HFILL }                                   \
1893
30
    },                                                                  \
1894
30
    { & name .hf.hs_server_keyex_ys,                                    \
1895
30
      { "Pubkey", prefix ".handshake.ys",                               \
1896
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1897
30
        "Diffie-Hellman server pubkey", HFILL }                         \
1898
30
    },                                                                  \
1899
30
    { & name .hf.hs_client_keyex_yc,                                    \
1900
30
      { "Pubkey", prefix ".handshake.yc",                               \
1901
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1902
30
        "Diffie-Hellman client pubkey", HFILL }                         \
1903
30
    },                                                                  \
1904
30
    { & name .hf.hs_server_keyex_point,                                 \
1905
30
      { "Pubkey", prefix ".handshake.server_point",                     \
1906
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1907
30
        "EC Diffie-Hellman server pubkey", HFILL }                      \
1908
30
    },                                                                  \
1909
30
    { & name .hf.hs_client_keyex_point,                                 \
1910
30
      { "Pubkey", prefix ".handshake.client_point",                     \
1911
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1912
30
        "EC Diffie-Hellman client pubkey", HFILL }                      \
1913
30
    },                                                                  \
1914
30
    { & name .hf.hs_server_keyex_xs_len,                                \
1915
30
      { "Pubkey Length", prefix ".handshake.xs_len",                    \
1916
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1917
30
        "Length of EC J-PAKE server public key", HFILL }                \
1918
30
    },                                                                  \
1919
30
    { & name .hf.hs_client_keyex_xc_len,                                \
1920
30
      { "Pubkey Length", prefix ".handshake.xc_len",                    \
1921
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1922
30
        "Length of EC J-PAKE client public key", HFILL }                \
1923
30
    },                                                                  \
1924
30
    { & name .hf.hs_server_keyex_xs,                                    \
1925
30
      { "Pubkey", prefix ".handshake.xs",                               \
1926
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1927
30
        "EC J-PAKE server public key", HFILL }                          \
1928
30
    },                                                                  \
1929
30
    { & name .hf.hs_client_keyex_xc,                                    \
1930
30
      { "Pubkey", prefix ".handshake.xc",                               \
1931
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1932
30
        "EC J-PAKE client public key", HFILL }                          \
1933
30
    },                                                                  \
1934
30
    { & name .hf.hs_server_keyex_vs_len,                                \
1935
30
      { "Ephemeral Pubkey Length", prefix ".handshake.vs_len",          \
1936
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1937
30
        "Length of EC J-PAKE server ephemeral public key", HFILL }      \
1938
30
    },                                                                  \
1939
30
    { & name .hf.hs_client_keyex_vc_len,                                \
1940
30
      { "Ephemeral Pubkey Length", prefix ".handshake.vc_len",          \
1941
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1942
30
        "Length of EC J-PAKE client ephemeral public key", HFILL }      \
1943
30
    },                                                                  \
1944
30
    { & name .hf.hs_server_keyex_vs,                                    \
1945
30
      { "Ephemeral Pubkey", prefix ".handshake.vs",                     \
1946
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1947
30
        "EC J-PAKE server ephemeral public key", HFILL }                \
1948
30
    },                                                                  \
1949
30
    { & name .hf.hs_client_keyex_vc,                                    \
1950
30
      { "Ephemeral Pubkey", prefix ".handshake.vc",                     \
1951
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1952
30
        "EC J-PAKE client ephemeral public key", HFILL }                \
1953
30
    },                                                                  \
1954
30
    { & name .hf.hs_server_keyex_rs_len,                                \
1955
30
      { "Schnorr signature Length", prefix ".handshake.rs_len",         \
1956
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1957
30
        "Length of EC J-PAKE server Schnorr signature", HFILL }         \
1958
30
    },                                                                  \
1959
30
    { & name .hf.hs_client_keyex_rc_len,                                \
1960
30
      { "Schnorr signature Length", prefix ".handshake.rc_len",         \
1961
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
1962
30
        "Length of EC J-PAKE client Schnorr signature", HFILL }         \
1963
30
    },                                                                  \
1964
30
    { & name .hf.hs_server_keyex_rs,                                    \
1965
30
      { "Schnorr signature", prefix ".handshake.rs",                    \
1966
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1967
30
        "EC J-PAKE server Schnorr signature", HFILL }                   \
1968
30
    },                                                                  \
1969
30
    { & name .hf.hs_client_keyex_rc,                                    \
1970
30
      { "Schnorr signature", prefix ".handshake.rc",                    \
1971
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1972
30
        "EC J-PAKE client Schnorr signature", HFILL }                   \
1973
30
    },                                                                  \
1974
30
    { & name .hf.hs_server_keyex_modulus,                               \
1975
30
      { "Modulus", prefix ".handshake.modulus",                         \
1976
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1977
30
        "RSA-EXPORT modulus", HFILL }                                   \
1978
30
    },                                                                  \
1979
30
    { & name .hf.hs_server_keyex_exponent,                              \
1980
30
      { "Exponent", prefix ".handshake.exponent",                       \
1981
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1982
30
        "RSA-EXPORT exponent", HFILL }                                  \
1983
30
    },                                                                  \
1984
30
    { & name .hf.hs_server_keyex_sig,                                   \
1985
30
      { "Signature", prefix ".handshake.sig",                           \
1986
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1987
30
        "Diffie-Hellman server signature", HFILL }                      \
1988
30
    },                                                                  \
1989
30
    { & name .hf.hs_server_keyex_hint_len,                              \
1990
30
      { "Hint Length", prefix ".handshake.hint_len",                    \
1991
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
1992
30
        "Length of PSK Hint", HFILL }                                   \
1993
30
    },                                                                  \
1994
30
    { & name .hf.hs_server_keyex_hint,                                  \
1995
30
      { "Hint", prefix ".handshake.hint",                               \
1996
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
1997
30
        "PSK Hint", HFILL }                                             \
1998
30
    },                                                                  \
1999
30
    { & name .hf.hs_client_keyex_identity_len,                          \
2000
30
      { "Identity Length", prefix ".handshake.identity_len",            \
2001
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2002
30
        "Length of PSK Identity", HFILL }                               \
2003
30
    },                                                                  \
2004
30
    { & name .hf.hs_client_keyex_identity,                              \
2005
30
      { "Identity", prefix ".handshake.identity",                       \
2006
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2007
30
        "PSK Identity", HFILL }                                         \
2008
30
    },                                                                  \
2009
30
    { & name .hf.hs_ext_heartbeat_mode,                                 \
2010
30
      { "Mode", prefix ".handshake.extension.heartbeat.mode",           \
2011
30
        FT_UINT8, BASE_DEC, VALS(tls_heartbeat_mode), 0x0,              \
2012
30
        "Heartbeat extension mode", HFILL }                             \
2013
30
    },                                                                  \
2014
30
    { & name .hf.hs_certificates_len,                                   \
2015
30
      { "Certificates Length", prefix ".handshake.certificates_length", \
2016
30
        FT_UINT24, BASE_DEC, NULL, 0x0,                                 \
2017
30
        "Length of certificates field", HFILL }                         \
2018
30
    },                                                                  \
2019
30
    { & name .hf.hs_certificates,                                       \
2020
30
      { "Certificates", prefix ".handshake.certificates",               \
2021
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2022
30
        "List of certificates", HFILL }                                 \
2023
30
    },                                                                  \
2024
30
    { & name .hf.hs_certificate,                                        \
2025
30
      { "Certificate", prefix ".handshake.certificate",                 \
2026
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                  \
2027
30
        NULL, HFILL }                                                   \
2028
30
    },                                                                  \
2029
30
    { & name .hf.hs_certificate_len,                                    \
2030
30
      { "Certificate Length", prefix ".handshake.certificate_length",   \
2031
30
        FT_UINT24, BASE_DEC, NULL, 0x0,                                 \
2032
30
        "Length of certificate", HFILL }                                \
2033
30
    },                                                                  \
2034
30
    { & name .hf.hs_cert_types_count,                                   \
2035
30
      { "Certificate types count", prefix ".handshake.cert_types_count",\
2036
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2037
30
        "Count of certificate types", HFILL }                           \
2038
30
    },                                                                  \
2039
30
    { & name .hf.hs_cert_types,                                         \
2040
30
      { "Certificate types", prefix ".handshake.cert_types",            \
2041
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2042
30
        "List of certificate types", HFILL }                            \
2043
30
    },                                                                  \
2044
30
    { & name .hf.hs_cert_type,                                          \
2045
30
      { "Certificate type", prefix ".handshake.cert_type",              \
2046
30
        FT_UINT8, BASE_DEC, VALS(ssl_31_client_certificate_type), 0x0,  \
2047
30
        NULL, HFILL }                                                   \
2048
30
    },                                                                  \
2049
30
    { & name .hf.hs_dnames_len,                                         \
2050
30
      { "Distinguished Names Length", prefix ".handshake.dnames_len",   \
2051
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2052
30
        "Length of list of CAs that server trusts", HFILL }             \
2053
30
    },                                                                  \
2054
30
    { & name .hf.hs_dnames,                                             \
2055
30
      { "Distinguished Names", prefix ".handshake.dnames",              \
2056
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2057
30
        "List of CAs that server trusts", HFILL }                       \
2058
30
    },                                                                  \
2059
30
    { & name .hf.hs_dname_len,                                          \
2060
30
      { "Distinguished Name Length", prefix ".handshake.dname_len",     \
2061
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2062
30
        "Length of distinguished name", HFILL }                         \
2063
30
    },                                                                  \
2064
30
    { & name .hf.hs_dnames_truncated,                                   \
2065
30
      { "Tree view truncated", prefix ".handshake.dnames_truncated",    \
2066
30
         FT_NONE, BASE_NONE, NULL, 0x00,                                \
2067
30
         "Some Distinguished Names are not added to tree pane to limit resources", HFILL } \
2068
30
    },                                                                  \
2069
30
    { & name .hf.hs_dname,                                              \
2070
30
      { "Distinguished Name", prefix ".handshake.dname",                \
2071
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2072
30
        "Distinguished name of a CA that server trusts", HFILL }        \
2073
30
    },                                                                  \
2074
30
    { & name .hf.hs_random,                                             \
2075
30
      { "Random", prefix ".handshake.random",                           \
2076
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2077
30
        "Random values used for deriving keys", HFILL }                 \
2078
30
    },                                                                  \
2079
30
    { & name .hf.hs_random_time,                                        \
2080
30
      { "GMT Unix Time", prefix ".handshake.random_time",               \
2081
30
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,               \
2082
30
        "Unix time field of random structure", HFILL }                  \
2083
30
    },                                                                  \
2084
30
    { & name .hf.hs_random_bytes,                                       \
2085
30
      { "Random Bytes", prefix ".handshake.random_bytes",               \
2086
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2087
30
        "Random values used for deriving keys", HFILL }                 \
2088
30
    },                                                                  \
2089
30
    { & name .hf.hs_session_id,                                         \
2090
30
      { "Session ID", prefix ".handshake.session_id",                   \
2091
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2092
30
        "Identifies the SSL session, allowing later resumption", HFILL }\
2093
30
    },                                                                  \
2094
30
    { & name .hf.hs_session_id_len,                                     \
2095
30
      { "Session ID Length", prefix ".handshake.session_id_length",     \
2096
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2097
30
        "Length of Session ID field", HFILL }                           \
2098
30
    },                                                                  \
2099
30
    { & name .hf.hs_client_version,                                     \
2100
30
      { "Version", prefix ".handshake.version",                         \
2101
30
        FT_UINT16, BASE_HEX, VALS(ssl_versions), 0x0,                   \
2102
30
        "Maximum version supported by client [legacy_version if supported_versions ext is present]", HFILL } \
2103
30
    },                                                                  \
2104
30
    { & name .hf.hs_server_version,                                     \
2105
30
      { "Version", prefix ".handshake.version",                         \
2106
30
        FT_UINT16, BASE_HEX, VALS(ssl_versions), 0x0,                   \
2107
30
        "Version selected by server [legacy_version if supported_versions ext is present]", HFILL } \
2108
30
    },                                                                  \
2109
30
    { & name .hf.hs_cipher_suites_len,                                  \
2110
30
      { "Cipher Suites Length", prefix ".handshake.cipher_suites_length", \
2111
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2112
30
        "Length of cipher suites field", HFILL }                        \
2113
30
    },                                                                  \
2114
30
    { & name .hf.hs_cipher_suites,                                      \
2115
30
      { "Cipher Suites", prefix ".handshake.ciphersuites",              \
2116
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2117
30
        "List of cipher suites supported by client", HFILL }            \
2118
30
    },                                                                  \
2119
30
    { & name .hf.hs_cipher_suite,                                       \
2120
30
      { "Cipher Suite", prefix ".handshake.ciphersuite",                \
2121
30
        FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ssl_31_ciphersuite_ext, 0x0, \
2122
30
        NULL, HFILL }                                                   \
2123
30
    },                                                                  \
2124
30
    { & name .hf.hs_comp_methods_len,                                   \
2125
30
      { "Compression Methods Length", prefix ".handshake.comp_methods_length", \
2126
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2127
30
        "Length of compression methods field", HFILL }                  \
2128
30
    },                                                                  \
2129
30
    { & name .hf.hs_comp_methods,                                       \
2130
30
      { "Compression Methods", prefix ".handshake.comp_methods",        \
2131
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2132
30
        "List of compression methods supported by client", HFILL }      \
2133
30
    },                                                                  \
2134
30
    { & name .hf.hs_comp_method,                                        \
2135
30
      { "Compression Method", prefix ".handshake.comp_method",          \
2136
30
        FT_UINT8, BASE_DEC, VALS(ssl_31_compression_method), 0x0,       \
2137
30
        NULL, HFILL }                                                   \
2138
30
    },                                                                  \
2139
30
    { & name .hf.hs_session_ticket_lifetime_hint,                       \
2140
30
      { "Session Ticket Lifetime Hint",                                 \
2141
30
        prefix ".handshake.session_ticket_lifetime_hint",               \
2142
30
        FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_second_seconds), 0x0, \
2143
30
        "New Session Ticket Lifetime Hint", HFILL }                     \
2144
30
    },                                                                  \
2145
30
    { & name .hf.hs_session_ticket_age_add,                             \
2146
30
      { "Session Ticket Age Add",                                       \
2147
30
        prefix ".handshake.session_ticket_age_add",                     \
2148
30
        FT_UINT32, BASE_DEC, NULL, 0x0,                                 \
2149
30
        "Random 32-bit value to obscure age of ticket", HFILL }         \
2150
30
    },                                                                  \
2151
30
    { & name .hf.hs_session_ticket_nonce_len,                           \
2152
30
      { "Session Ticket Nonce Length", prefix ".handshake.session_ticket_nonce_length", \
2153
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2154
30
        NULL, HFILL }                                                   \
2155
30
    },                                                                  \
2156
30
    { & name .hf.hs_session_ticket_nonce,                               \
2157
30
      { "Session Ticket Nonce", prefix ".handshake.session_ticket_nonce",   \
2158
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2159
30
        "A unique per-ticket value", HFILL }                            \
2160
30
    },                                                                  \
2161
30
    { & name .hf.hs_session_ticket_len,                                 \
2162
30
      { "Session Ticket Length", prefix ".handshake.session_ticket_length", \
2163
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2164
30
        "New Session Ticket Length", HFILL }                            \
2165
30
    },                                                                  \
2166
30
    { & name .hf.hs_session_ticket,                                     \
2167
30
      { "Session Ticket", prefix ".handshake.session_ticket",           \
2168
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2169
30
        "New Session Ticket", HFILL }                                   \
2170
30
    },                                                                  \
2171
30
    { & name .hf.hs_finished,                                           \
2172
30
      { "Verify Data", prefix ".handshake.verify_data",                 \
2173
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2174
30
        "Opaque verification data", HFILL }                             \
2175
30
    },                                                                  \
2176
30
    { & name .hf.hs_client_cert_vrfy_sig_len,                           \
2177
30
      { "Signature length", prefix ".handshake.client_cert_vrfy.sig_len", \
2178
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2179
30
        "Length of CertificateVerify's signature", HFILL }              \
2180
30
    },                                                                  \
2181
30
    { & name .hf.hs_client_cert_vrfy_sig,                               \
2182
30
      { "Signature", prefix ".handshake.client_cert_vrfy.sig",          \
2183
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2184
30
        "CertificateVerify's signature", HFILL }                        \
2185
30
    },                                                                  \
2186
30
    { & name .hf.hs_ja3_full,                                           \
2187
30
      { "JA3 Fullstring", prefix ".handshake.ja3_full",                 \
2188
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
2189
30
        NULL, HFILL }                                                   \
2190
30
    },                                                                  \
2191
30
    { & name .hf.hs_ja3_hash,                                           \
2192
30
      { "JA3", prefix ".handshake.ja3",                                 \
2193
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
2194
30
        NULL, HFILL }                                                   \
2195
30
    },                                                                  \
2196
30
    { & name .hf.hs_ja3s_full,                                          \
2197
30
      { "JA3S Fullstring", prefix ".handshake.ja3s_full",               \
2198
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
2199
30
        NULL, HFILL }                                                   \
2200
30
    },                                                                  \
2201
30
    { & name .hf.hs_ja3s_hash,                                          \
2202
30
      { "JA3S", prefix ".handshake.ja3s",                               \
2203
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
2204
30
        NULL, HFILL }                                                   \
2205
30
    },                                                                  \
2206
30
    { & name .hf.hs_ja4,                                                \
2207
30
      { "JA4", prefix ".handshake.ja4",                                 \
2208
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
2209
30
        NULL, HFILL }                                                   \
2210
30
    },                                                                  \
2211
30
    { & name .hf.hs_ja4_r,                                              \
2212
30
      { "JA4_r", prefix ".handshake.ja4_r",                             \
2213
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
2214
30
        NULL, HFILL }                                                   \
2215
30
    },                                                                  \
2216
30
    { & name .hf.hs_ext_psk_ke_modes_length,                            \
2217
30
      { "PSK Key Exchange Modes Length", prefix ".extension.psk_ke_modes_length", \
2218
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2219
30
        NULL, HFILL }                                                   \
2220
30
    },                                                                  \
2221
30
    { & name .hf.hs_ext_psk_ke_mode,                                    \
2222
30
      { "PSK Key Exchange Mode", prefix ".extension.psk_ke_mode",       \
2223
30
        FT_UINT8, BASE_DEC, VALS(tls_hello_ext_psk_ke_mode), 0x0,       \
2224
30
        "Key exchange modes where the client supports use of PSKs", HFILL } \
2225
30
    },                                                                  \
2226
30
    { & name .hf.hs_certificate_request_context_length,                 \
2227
30
      { "Certificate Request Context Length", prefix ".handshake.certificate_request_context_length", \
2228
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2229
30
        NULL, HFILL }                                                   \
2230
30
    },                                                                  \
2231
30
    { & name .hf.hs_certificate_request_context,                        \
2232
30
      { "Certificate Request Context", prefix ".handshake.certificate_request_context", \
2233
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2234
30
        "Value from CertificateRequest or empty for server auth", HFILL } \
2235
30
    },                                                                  \
2236
30
    { & name .hf.hs_key_update_request_update,                          \
2237
30
      { "Key Update Request", prefix ".handshake.key_update.request_update", \
2238
30
        FT_UINT8, BASE_DEC, VALS(tls13_key_update_request), 0x00,       \
2239
30
        "Whether the receiver should also update its keys", HFILL }     \
2240
30
    },                                                                  \
2241
30
    { & name .hf.sct_scts_length,                                       \
2242
30
      { "Serialized SCT List Length", prefix ".sct.scts_length",        \
2243
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2244
30
        NULL, HFILL }                                                   \
2245
30
    },                                                                  \
2246
30
    { & name .hf.sct_sct_length,                                        \
2247
30
      { "Serialized SCT Length", prefix ".sct.sct_length",              \
2248
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2249
30
        NULL, HFILL }                                                   \
2250
30
    },                                                                  \
2251
30
    { & name .hf.sct_sct_version,                                       \
2252
30
      { "SCT Version", prefix ".sct.sct_version",                       \
2253
30
        FT_UINT8, BASE_DEC, NULL, 0x00,                                 \
2254
30
        "SCT Protocol version (v1 (0) is defined in RFC 6962)", HFILL } \
2255
30
    },                                                                  \
2256
30
    { & name .hf.sct_sct_logid,                                         \
2257
30
      { "Log ID", prefix ".sct.sct_logid",                              \
2258
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2259
30
        "SHA-256 hash of log's public key", HFILL }                     \
2260
30
    },                                                                  \
2261
30
    { & name .hf.sct_sct_timestamp,                                     \
2262
30
      { "Timestamp", prefix ".sct.sct_timestamp",                       \
2263
30
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x00,                \
2264
30
        "Timestamp of issuance", HFILL }                                \
2265
30
    },                                                                  \
2266
30
    { & name .hf.sct_sct_extensions_length,                             \
2267
30
      { "Extensions length", prefix ".sct.sct_extensions_length",       \
2268
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2269
30
        "Length of future extensions to this protocol (currently none)", HFILL } \
2270
30
    },                                                                  \
2271
30
    { & name .hf.sct_sct_extensions,                                    \
2272
30
      { "Extensions", prefix ".sct.sct_extensions",                     \
2273
30
        FT_NONE, BASE_NONE, NULL, 0x00,                                 \
2274
30
        "Future extensions to this protocol (currently none)", HFILL }  \
2275
30
    },                                                                  \
2276
30
    { & name .hf.sct_sct_signature_length,                              \
2277
30
      { "Signature Length", prefix ".sct.sct_signature_length",         \
2278
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2279
30
        NULL, HFILL }                                                   \
2280
30
    },                                                                  \
2281
30
    { & name .hf.sct_sct_signature,                                     \
2282
30
      { "Signature", prefix ".sct.sct_signature",                       \
2283
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2284
30
        NULL, HFILL }                                                   \
2285
30
    },                                                                  \
2286
30
    { & name .hf.hs_ext_max_early_data_size,                            \
2287
30
      { "Maximum Early Data Size", prefix ".early_data.max_early_data_size", \
2288
30
        FT_UINT32, BASE_DEC, NULL, 0x00,                                \
2289
30
        "Maximum amount of 0-RTT data that the client may send", HFILL } \
2290
30
    },                                                                  \
2291
30
    { & name .hf.hs_ext_oid_filters_length,                             \
2292
30
      { "OID Filters Length", prefix ".extension.oid_filters_length",   \
2293
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2294
30
        NULL, HFILL }                                                   \
2295
30
    },                                                                  \
2296
30
    { & name .hf.hs_ext_oid_filters_oid_length,                         \
2297
30
      { "Certificate Extension OID Length", prefix ".extension.oid_filters.oid_length", \
2298
30
        FT_UINT8, BASE_DEC, NULL, 0x00,                                 \
2299
30
        NULL, HFILL }                                                   \
2300
30
    },                                                                  \
2301
30
    { & name .hf.hs_ext_oid_filters_oid,                                \
2302
30
      { "Certificate Extension OID", prefix ".extension.oid_filters.oid", \
2303
30
        FT_OID, BASE_NONE, NULL, 0x00,                                  \
2304
30
        NULL, HFILL }                                                   \
2305
30
    },                                                                  \
2306
30
    { & name .hf.hs_ext_oid_filters_values_length,                      \
2307
30
      { "Certificate Extension Values Length", prefix ".extension.oid_filters.values_length", \
2308
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2309
30
        NULL, HFILL }                                                   \
2310
30
    },                                                                  \
2311
30
    { & name .hf.hs_cred_valid_time,                                    \
2312
30
      { "Valid Time", prefix ".handshake.cred.valid_time",              \
2313
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2314
30
        "Delegated Credentials Valid Time", HFILL }                     \
2315
30
    },                                                                  \
2316
30
    { & name .hf.hs_cred_pubkey,                                        \
2317
30
      { "Subject Public Key Info", prefix ".handshake.cred.pubkey",     \
2318
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2319
30
        "Delegated Credentials Subject Public Key Info", HFILL }        \
2320
30
    },                                                                  \
2321
30
    { & name .hf.hs_cred_pubkey_len,                                    \
2322
30
      { "Subject Public Key Info Length", prefix ".handshake.cred.pubkey_len", \
2323
30
        FT_UINT24, BASE_DEC, NULL, 0x0,                                 \
2324
30
        "Delegated Credentials Subject Public Key Info Length", HFILL } \
2325
30
    },                                                                  \
2326
30
    { & name .hf.hs_cred_signature,                                     \
2327
30
      { "Signature", prefix ".handshake.cred.signature",                \
2328
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2329
30
        "Delegated Credentials Signature", HFILL }                      \
2330
30
    },                                                                  \
2331
30
    { & name .hf.hs_cred_signature_len,                                 \
2332
30
      { "Signature Length", prefix ".handshake.cred.signature_len",     \
2333
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2334
30
        "Delegated Credentials Signature Length", HFILL }               \
2335
30
    },                                                                  \
2336
30
    { & name .hf.hs_ext_compress_certificate_algorithms_length,         \
2337
30
      { "Algorithms Length", prefix ".compress_certificate.algorithms_length", \
2338
30
        FT_UINT8, BASE_DEC, NULL, 0x00,                                 \
2339
30
        NULL, HFILL }                                                   \
2340
30
    },                                                                  \
2341
30
    { & name .hf.hs_ext_compress_certificate_algorithm,                 \
2342
30
      { "Algorithm", prefix ".compress_certificate.algorithm",          \
2343
30
        FT_UINT16, BASE_DEC, VALS(compress_certificate_algorithm_vals), 0x00, \
2344
30
        NULL, HFILL }                                                   \
2345
30
    },                                                                  \
2346
30
    { & name .hf.hs_ext_compress_certificate_uncompressed_length,       \
2347
30
      { "Uncompressed Length", prefix ".compress_certificate.uncompressed_length", \
2348
30
        FT_UINT24, BASE_DEC, NULL, 0x00,                                \
2349
30
        NULL, HFILL }                                                   \
2350
30
    },                                                                  \
2351
30
    { & name .hf.hs_ext_compress_certificate_compressed_certificate_message_length, \
2352
30
      { "Length", prefix ".compress_certificate.compressed_certificate_message.length", \
2353
30
        FT_UINT24, BASE_DEC, NULL, 0x00,                                \
2354
30
        NULL, HFILL }                                                   \
2355
30
    },                                                                  \
2356
30
    { & name .hf.hs_ext_compress_certificate_compressed_certificate_message, \
2357
30
      { "Compressed Certificate Message", prefix ".compress_certificate.compressed_certificate_message", \
2358
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2359
30
        NULL, HFILL }                                                   \
2360
30
    },                                                                  \
2361
30
    { & name .hf.hs_ext_token_binding_version_major,                    \
2362
30
      { "Protocol Major Version", prefix ".token_binding.version_major", \
2363
30
        FT_UINT8, BASE_HEX, NULL, 0x00,                                 \
2364
30
        "Major version of the Token Binding protocol", HFILL }          \
2365
30
    },                                                                  \
2366
30
    { & name .hf.hs_ext_token_binding_version_minor,                    \
2367
30
      { "Protocol Minor Version", prefix ".token_binding.version_minor", \
2368
30
        FT_UINT8, BASE_HEX, NULL, 0x00,                                 \
2369
30
        "Minor version of the Token Binding protocol", HFILL }          \
2370
30
    },                                                                  \
2371
30
    { & name .hf.hs_ext_token_binding_key_parameters,                   \
2372
30
      { "Key Parameters", prefix ".token_binding.key_parameters",       \
2373
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2374
30
        NULL, HFILL }                                                   \
2375
30
    },                                                                  \
2376
30
    { & name .hf.hs_ext_token_binding_key_parameters_length,            \
2377
30
      { "Key Parameters Length", prefix ".token_binding.key_parameters_length", \
2378
30
        FT_UINT8, BASE_DEC, NULL, 0x00,                                 \
2379
30
        "Length of the key parameters list", HFILL }                    \
2380
30
    },                                                                  \
2381
30
    { & name .hf.hs_ext_token_binding_key_parameter,                    \
2382
30
      { "Key Parameter", prefix ".token_binding.key_parameter",         \
2383
30
        FT_UINT8, BASE_DEC, VALS(token_binding_key_parameter_vals), 0x00, \
2384
30
        "Identifier of the Token Binding key parameter", HFILL }         \
2385
30
    },                                                                  \
2386
30
    { & name .hf.hs_ext_record_size_limit,                              \
2387
30
      { "Record Size Limit", prefix ".record_size_limit",               \
2388
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2389
30
        "Maximum record size that an endpoint is willing to receive", HFILL } \
2390
30
    },                                                                  \
2391
30
    { & name .hf.hs_ext_quictp_len,                                     \
2392
30
      { "Parameters Length", prefix ".quic.len",                        \
2393
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2394
30
        NULL, HFILL }                                                   \
2395
30
    },                                                                  \
2396
30
    { & name .hf.hs_ext_quictp_parameter,                               \
2397
30
      { "Parameter", prefix ".quic.parameter",                          \
2398
30
        FT_NONE, BASE_NONE, NULL, 0x00,                                 \
2399
30
        NULL, HFILL }                                                   \
2400
30
    },                                                                  \
2401
30
    { & name .hf.hs_ext_quictp_parameter_type,                          \
2402
30
      { "Type", prefix ".quic.parameter.type",                          \
2403
30
        FT_UINT64, BASE_CUSTOM, CF_FUNC(quic_transport_parameter_id_base_custom), 0x00,    \
2404
30
        NULL, HFILL }                                                   \
2405
30
    },                                                                  \
2406
30
    { & name .hf.hs_ext_quictp_parameter_len,                           \
2407
30
      { "Length", prefix ".quic.parameter.length",                      \
2408
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2409
30
        NULL, HFILL }                                                   \
2410
30
    },                                                                  \
2411
30
    { & name .hf.hs_ext_quictp_parameter_len_old,                       \
2412
30
      { "Length", prefix ".quic.parameter.length.old",                  \
2413
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2414
30
        NULL, HFILL }                                                   \
2415
30
    },                                                                  \
2416
30
    { & name .hf.hs_ext_quictp_parameter_value,                         \
2417
30
      { "Value", prefix ".quic.parameter.value",                        \
2418
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2419
30
        NULL, HFILL }                                                   \
2420
30
    },                                                                  \
2421
30
    { & name .hf.hs_ext_quictp_parameter_original_destination_connection_id, \
2422
30
      { "original_destination_connection_id", prefix ".quic.parameter.original_destination_connection_id", \
2423
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2424
30
        "Destination Connection ID from the first Initial packet sent by the client", HFILL } \
2425
30
    },                                                                  \
2426
30
    { & name .hf.hs_ext_quictp_parameter_max_idle_timeout,              \
2427
30
      { "max_idle_timeout", prefix ".quic.parameter.max_idle_timeout",  \
2428
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2429
30
        "In milliseconds", HFILL }                                      \
2430
30
    },                                                                  \
2431
30
    { & name .hf.hs_ext_quictp_parameter_stateless_reset_token,         \
2432
30
      { "stateless_reset_token", prefix ".quic.parameter.stateless_reset_token",    \
2433
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2434
30
        "Used in verifying a stateless reset", HFILL }                  \
2435
30
    },                                                                  \
2436
30
    { & name .hf.hs_ext_quictp_parameter_max_udp_payload_size,          \
2437
30
      { "max_udp_payload_size", prefix ".quic.parameter.max_udp_payload_size", \
2438
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2439
30
        "Maximum UDP payload size that the endpoint is willing to receive", HFILL }    \
2440
30
    },                                                                  \
2441
30
    { & name .hf.hs_ext_quictp_parameter_initial_max_data,              \
2442
30
      { "initial_max_data", prefix ".quic.parameter.initial_max_data",  \
2443
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2444
30
        "Contains the initial value for the maximum amount of data that can be sent on the connection", HFILL }                                                                 \
2445
30
    },                                                                  \
2446
30
    { & name .hf.hs_ext_quictp_parameter_initial_max_stream_data_bidi_local, \
2447
30
      { "initial_max_stream_data_bidi_local", prefix ".quic.parameter.initial_max_stream_data_bidi_local", \
2448
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2449
30
        "Initial stream maximum data for bidirectional, locally-initiated streams", HFILL }                                                                 \
2450
30
    },                                                                  \
2451
30
    { & name .hf.hs_ext_quictp_parameter_initial_max_stream_data_bidi_remote, \
2452
30
      { "initial_max_stream_data_bidi_remote", prefix ".quic.parameter.initial_max_stream_data_bidi_remote", \
2453
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2454
30
        "Initial stream maximum data for bidirectional, peer-initiated streams", HFILL }                                                                 \
2455
30
    },                                                                  \
2456
30
    { & name .hf.hs_ext_quictp_parameter_initial_max_stream_data_uni,   \
2457
30
      { "initial_max_stream_data_uni", prefix ".quic.parameter.initial_max_stream_data_uni", \
2458
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2459
30
        "Initial stream maximum data for unidirectional streams parameter", HFILL } \
2460
30
    },                                                                  \
2461
30
    { & name .hf.hs_ext_quictp_parameter_initial_max_streams_bidi,      \
2462
30
      { "initial_max_streams_bidi", prefix ".quic.parameter.initial_max_streams_bidi",  \
2463
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2464
30
        "Initial maximum number of application-owned bidirectional streams", HFILL } \
2465
30
    },                                                                  \
2466
30
    { & name .hf.hs_ext_quictp_parameter_initial_max_streams_uni,       \
2467
30
      { "initial_max_streams_uni", prefix ".quic.parameter.initial_max_streams_uni",    \
2468
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2469
30
        "Initial maximum number of application-owned unidirectional streams", HFILL }   \
2470
30
    },                                                                  \
2471
30
    { & name .hf.hs_ext_quictp_parameter_ack_delay_exponent,            \
2472
30
      { "ack_delay_exponent", prefix ".quic.parameter.ack_delay_exponent",  \
2473
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2474
30
        "Indicating an exponent used to decode the ACK Delay field in the ACK frame,", HFILL }  \
2475
30
    },                                                                  \
2476
30
    { & name .hf.hs_ext_quictp_parameter_max_ack_delay,                 \
2477
30
      { "max_ack_delay", prefix ".quic.parameter.max_ack_delay",        \
2478
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2479
30
        "Indicating the maximum amount of time in milliseconds by which it will delay sending of acknowledgments", HFILL } \
2480
30
    },                                                                  \
2481
30
    { & name .hf.hs_ext_quictp_parameter_pa_ipv4address,                \
2482
30
      { "ipv4Address", prefix ".quic.parameter.preferred_address.ipv4address",  \
2483
30
        FT_IPv4, BASE_NONE, NULL, 0x00,                                 \
2484
30
        NULL, HFILL }                                                   \
2485
30
    },                                                                  \
2486
30
    { & name .hf.hs_ext_quictp_parameter_pa_ipv6address,                \
2487
30
      { "ipv6Address", prefix ".quic.parameter.preferred_address.ipv6address",  \
2488
30
        FT_IPv6, BASE_NONE, NULL, 0x00,                                 \
2489
30
        NULL, HFILL }                                                   \
2490
30
    },                                                                  \
2491
30
    { & name .hf.hs_ext_quictp_parameter_pa_ipv4port,                   \
2492
30
      { "ipv4Port", prefix ".quic.parameter.preferred_address.ipv4port", \
2493
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2494
30
        NULL, HFILL }                                                   \
2495
30
    },                                                                  \
2496
30
    { & name .hf.hs_ext_quictp_parameter_pa_ipv6port,                   \
2497
30
      { "ipv6Port", prefix ".quic.parameter.preferred_address.ipv6port", \
2498
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2499
30
        NULL, HFILL }                                                   \
2500
30
    },                                                                  \
2501
30
    { & name .hf.hs_ext_quictp_parameter_pa_connectionid_length,        \
2502
30
      { "Length", prefix ".quic.parameter.preferred_address.connectionid.length",   \
2503
30
        FT_UINT8, BASE_DEC, NULL, 0x00,                                 \
2504
30
        "Length of connectionId Field", HFILL }                         \
2505
30
    },                                                                  \
2506
30
    { & name .hf.hs_ext_quictp_parameter_pa_connectionid,               \
2507
30
      { "connectionId", prefix ".quic.parameter.preferred_address.connectionid",    \
2508
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2509
30
        NULL, HFILL }                                                   \
2510
30
    },                                                                  \
2511
30
    { & name .hf.hs_ext_quictp_parameter_pa_statelessresettoken,        \
2512
30
      { "statelessResetToken", prefix ".quic.parameter.preferred_address.statelessresettoken",  \
2513
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2514
30
        NULL, HFILL }                                                   \
2515
30
    },                                                                  \
2516
30
    { & name .hf.hs_ext_quictp_parameter_active_connection_id_limit,    \
2517
30
      { "Active Connection ID Limit", prefix ".quic.parameter.active_connection_id_limit", \
2518
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2519
30
        NULL, HFILL }                                                   \
2520
30
    },                                                                  \
2521
30
    { & name .hf.hs_ext_quictp_parameter_initial_source_connection_id,  \
2522
30
      { "Initial Source Connection ID", prefix ".quic.parameter.initial_source_connection_id", \
2523
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2524
30
        NULL, HFILL }                                                   \
2525
30
    },                                                                  \
2526
30
    { & name .hf.hs_ext_quictp_parameter_retry_source_connection_id,    \
2527
30
      { "Retry Source Connection ID", prefix ".quic.parameter.retry_source_connection_id", \
2528
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2529
30
        NULL, HFILL }                                                   \
2530
30
    },                                                                  \
2531
30
    { & name .hf.hs_ext_quictp_parameter_max_datagram_frame_size,       \
2532
30
      { "max_datagram_frame_size", prefix ".quic.parameter.max_datagram_frame_size", \
2533
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2534
30
        NULL, HFILL }                                                   \
2535
30
    },                                                                  \
2536
30
    { & name .hf.hs_ext_quictp_parameter_cibir_encoding_length,         \
2537
30
      { "length", prefix ".quic.parameter.cibir_encoding.length",       \
2538
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2539
30
        NULL, HFILL }                                                   \
2540
30
    },                                                                  \
2541
30
    { & name .hf.hs_ext_quictp_parameter_cibir_encoding_offset,         \
2542
30
      { "offset", prefix ".quic.parameter.cibir_encoding.offset",       \
2543
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2544
30
        NULL, HFILL }                                                   \
2545
30
    },                                                                  \
2546
30
    { & name .hf.hs_ext_quictp_parameter_loss_bits,                     \
2547
30
      { "loss_bits", prefix ".quic.parameter.loss_bits",                \
2548
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2549
30
        NULL, HFILL }                                                   \
2550
30
    },                                                                  \
2551
30
    { & name .hf.hs_ext_quictp_parameter_address_discovery,             \
2552
30
      { "address_discovery", prefix ".quic.parameter.address_discovery",  \
2553
30
        FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(quic_address_discovery_vals), 0x00,  \
2554
30
        NULL, HFILL }                                                   \
2555
30
    },                                                                  \
2556
30
    { & name .hf.hs_ext_quictp_parameter_enable_time_stamp_v2,          \
2557
30
      { "Enable TimestampV2", prefix ".quic.parameter.enable_time_stamp_v2", \
2558
30
        FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(quic_enable_time_stamp_v2_vals), 0x00,                                \
2559
30
        NULL, HFILL }                                                   \
2560
30
    },                                                                  \
2561
30
    { & name .hf.hs_ext_quictp_parameter_min_ack_delay,                 \
2562
30
      { "min_ack_delay", prefix ".quic.parameter.min_ack_delay",        \
2563
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2564
30
        NULL, HFILL }                                                   \
2565
30
    },                                                                  \
2566
30
    { & name .hf.hs_ext_quictp_parameter_google_user_agent_id,          \
2567
30
      { "Google UserAgent", prefix ".quic.parameter.google.user_agent", \
2568
30
        FT_STRING, BASE_NONE, NULL, 0x00,                               \
2569
30
        NULL, HFILL }                                                   \
2570
30
    },                                                                  \
2571
30
    { & name .hf.hs_ext_quictp_parameter_google_key_update_not_yet_supported, \
2572
30
      { "Google Key Update not yet supported", prefix ".quic.parameter.google.key_update_not_yet_supported", \
2573
30
        FT_NONE, BASE_NONE, NULL, 0x00,                                 \
2574
30
        NULL, HFILL }                                                   \
2575
30
    },                                                                  \
2576
30
    { & name .hf.hs_ext_quictp_parameter_google_quic_version,           \
2577
30
      { "Google QUIC version", prefix ".quic.parameter.google.quic_version", \
2578
30
        FT_UINT32, BASE_RANGE_STRING | BASE_HEX, RVALS(quic_version_vals), 0x00, \
2579
30
        NULL, HFILL }                                                   \
2580
30
    },                                                                  \
2581
30
    { & name .hf.hs_ext_quictp_parameter_google_initial_rtt,            \
2582
30
      { "Google Initial RTT", prefix ".quic.parameter.google.initial_rtt", \
2583
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2584
30
        NULL, HFILL }                                                   \
2585
30
    },                                                                  \
2586
30
    { & name .hf.hs_ext_quictp_parameter_google_support_handshake_done, \
2587
30
      { "Google Support Handshake Done", prefix ".quic.parameter.google.support_handshake_done", \
2588
30
        FT_NONE, BASE_NONE, NULL, 0x00,                                 \
2589
30
        NULL, HFILL }                                                   \
2590
30
    },                                                                  \
2591
30
    { & name .hf.hs_ext_quictp_parameter_google_quic_params,            \
2592
30
      { "Google QUIC parameters", prefix ".quic.parameter.google.quic_params", \
2593
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2594
30
        NULL, HFILL }                                                   \
2595
30
    },                                                                  \
2596
30
    { & name .hf.hs_ext_quictp_parameter_google_quic_params_unknown_field, \
2597
30
      { "Google Unknown Field", prefix ".quic.parameter.google.quic_params_unknown_field", \
2598
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2599
30
        NULL, HFILL }                                                   \
2600
30
    },                                                                  \
2601
30
    { & name .hf.hs_ext_quictp_parameter_google_connection_options,     \
2602
30
      { "Google Connection options", prefix ".quic.parameter.google.connection_options", \
2603
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2604
30
        NULL, HFILL }                                                   \
2605
30
    },                                                                  \
2606
30
    { & name .hf.hs_ext_quictp_parameter_google_supported_versions_length, \
2607
30
      { "Google Supported Versions Length", prefix ".quic.parameter.google.supported_versions_length", \
2608
30
        FT_UINT8, BASE_DEC, NULL, 0x00,                                 \
2609
30
        NULL, HFILL }                                                   \
2610
30
    },                                                                  \
2611
30
    { & name .hf.hs_ext_quictp_parameter_google_supported_version,      \
2612
30
      { "Google Supported Version", prefix ".quic.parameter.google.supported_version", \
2613
30
        FT_UINT32, BASE_RANGE_STRING | BASE_HEX, RVALS(quic_version_vals), 0x00, \
2614
30
        NULL, HFILL }                                                   \
2615
30
    },                                                                  \
2616
30
    { & name .hf.hs_ext_quictp_parameter_facebook_partial_reliability,     \
2617
30
      { "Facebook Partial Reliability", prefix ".quic.parameter.facebook.partial_reliability", \
2618
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2619
30
        NULL, HFILL }                                                   \
2620
30
    },                                                                  \
2621
30
    { & name .hf.hs_ext_quictp_parameter_chosen_version,                \
2622
30
      { "Chosen Version", prefix ".quic.parameter.vi.chosen_version",   \
2623
30
        FT_UINT32, BASE_RANGE_STRING | BASE_HEX, RVALS(quic_version_vals), 0x00, \
2624
30
        NULL, HFILL }                                                   \
2625
30
    },                                                                  \
2626
30
    { & name .hf.hs_ext_quictp_parameter_other_version,                 \
2627
30
      { "Other Version", prefix ".quic.parameter.vi.other_version",     \
2628
30
        FT_UINT32, BASE_RANGE_STRING | BASE_HEX, RVALS(quic_version_vals), 0x00, \
2629
30
        NULL, HFILL }                                                   \
2630
30
    },                                                                  \
2631
30
    { & name .hf.hs_ext_quictp_parameter_enable_multipath,              \
2632
30
      { "Enable Multipath", prefix ".quic.parameter.enable_multipath", \
2633
30
        FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(quic_enable_multipath_vals), 0x00,                                \
2634
30
        NULL, HFILL }                                                   \
2635
30
    },                                                                  \
2636
30
    { & name .hf.hs_ext_quictp_parameter_initial_max_paths,             \
2637
30
      { "Initial Max Paths", prefix ".quic.parameter.initial_max_paths", \
2638
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2639
30
        NULL, HFILL }                                                   \
2640
30
    },                                                                  \
2641
30
    { & name .hf.hs_ext_quictp_parameter_initial_max_path_id,           \
2642
30
      { "Initial Max Path ID", prefix ".quic.parameter.initial_max_path_id", \
2643
30
        FT_UINT64, BASE_DEC, NULL, 0x00,                                \
2644
30
        NULL, HFILL }                                                   \
2645
30
    },                                                                  \
2646
30
    { & name .hf.hs_ext_connection_id_length,                           \
2647
30
      { "Connection ID length", prefix ".connection_id_length",         \
2648
30
        FT_UINT8, BASE_DEC, NULL, 0x00,                                 \
2649
30
        NULL, HFILL }                                                   \
2650
30
    },                                                                  \
2651
30
    { & name .hf.hs_ext_connection_id,                                  \
2652
30
      { "Connection ID", prefix ".connection_id",                       \
2653
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2654
30
        NULL, HFILL }                                                   \
2655
30
    },                                                                  \
2656
30
    { & name .hf.hs_ext_trusted_ca_keys_len,                            \
2657
30
      { "Trusted CA keys length", prefix ".handshake.trusted_ca.keys_length", \
2658
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2659
30
        "Length of Trusted CA keys extension", HFILL }                  \
2660
30
    },                                                                  \
2661
30
    { & name .hf.hs_ext_trusted_ca_keys_list,                           \
2662
30
      { "Trusted CA keys", prefix ".handshake.trusted_ca.keys",         \
2663
30
        FT_NONE, BASE_NONE, NULL, 0x00,                                 \
2664
30
        "List of Trusted CA keys", HFILL }                              \
2665
30
    },                                                                  \
2666
30
    { & name .hf.hs_ext_trusted_ca_key,                                 \
2667
30
      { "Trusted CA key", prefix ".handshake.trusted_ca.key",           \
2668
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2669
30
        NULL, HFILL }                                                   \
2670
30
    },                                                                  \
2671
30
    { & name .hf.hs_ext_trusted_ca_key_type,                            \
2672
30
      { "Trusted CA key type", prefix ".handshake.trusted_ca.key_type", \
2673
30
        FT_UINT8, BASE_DEC, VALS(tls_hello_ext_trusted_ca_key_type), 0x00, \
2674
30
        "Type of Trusted CA key", HFILL }                               \
2675
30
    },                                                                  \
2676
30
    { & name .hf.hs_ext_trusted_ca_key_hash,                            \
2677
30
      { "Trusted CA key hash", prefix ".handshake.trusted_ca.key_hash", \
2678
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2679
30
        NULL, HFILL }                                                   \
2680
30
    },                                                                  \
2681
30
    { & name .hf.hs_ext_trusted_ca_key_dname_len,                       \
2682
30
      { "Distinguished Name Length", prefix ".handshake.trusted_ca.key_dname_len", \
2683
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2684
30
        "Length of distinguished name", HFILL }                         \
2685
30
    },                                                                  \
2686
30
    { & name .hf.hs_ext_trusted_ca_key_dname,                           \
2687
30
      { "Distinguished Name", prefix ".handshake.trusted_ca.key_dname", \
2688
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2689
30
        "Distinguished name of a CA that the client trusts", HFILL }    \
2690
30
    },                                                                  \
2691
30
    { & name .hf.esni_suite,                                            \
2692
30
      { "Cipher Suite", prefix ".esni.suite",                           \
2693
30
        FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ssl_31_ciphersuite_ext, 0x0, \
2694
30
        "Cipher suite used to encrypt the SNI", HFILL }                 \
2695
30
    },                                                                  \
2696
30
    { & name .hf.esni_record_digest_length,                             \
2697
30
      { "Record Digest Length", prefix ".esni.record_digest_length",    \
2698
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2699
30
        NULL, HFILL }                                                   \
2700
30
    },                                                                  \
2701
30
    { & name .hf.esni_record_digest,                                    \
2702
30
      { "Record Digest", prefix ".esni.record_digest",                  \
2703
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2704
30
        "Cryptographic hash of the ESNIKeys from which the ESNI key was obtained", HFILL } \
2705
30
    },                                                                  \
2706
30
    { & name .hf.esni_encrypted_sni_length,                             \
2707
30
      { "Encrypted SNI Length", prefix ".esni.encrypted_sni_length",    \
2708
30
        FT_UINT16, BASE_DEC, NULL, 0x00,                                \
2709
30
        NULL, HFILL }                                                   \
2710
30
    },                                                                  \
2711
30
    { & name .hf.esni_encrypted_sni,                                    \
2712
30
      { "Encrypted SNI", prefix ".esni.encrypted_sni",                  \
2713
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2714
30
        "The encrypted ClientESNIInner structure", HFILL }              \
2715
30
    },                                                                  \
2716
30
    { & name .hf.esni_nonce,                                            \
2717
30
      { "Nonce", prefix ".esni.nonce",                                  \
2718
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2719
30
        "Contents of ClientESNIInner.nonce", HFILL }                    \
2720
30
    },                                                                  \
2721
30
    { & name .hf.ech_echconfiglist_length,                              \
2722
30
      { "ECHConfigList length", prefix ".ech.echconfiglist_length",     \
2723
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2724
30
        "Encrypted ClientHello (ECH) Configurations length", HFILL }    \
2725
30
    },                                                                  \
2726
30
    { & name .hf.ech_echconfiglist,                                     \
2727
30
      { "ECHConfigList", prefix ".ech.echconfiglist",                   \
2728
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2729
30
        "Encrypted ClientHello (ECH) Configurations", HFILL }           \
2730
30
    },                                                                  \
2731
30
    { & name .hf.ech_echconfig,                                         \
2732
30
      { "ECHConfig", prefix ".ech.echconfig",                           \
2733
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2734
30
        "Encrypted ClientHello (ECH) Configuration", HFILL }            \
2735
30
    },                                                                  \
2736
30
    { & name .hf.ech_echconfig_version,                                 \
2737
30
      { "Version", prefix ".ech.echconfig.version",                     \
2738
30
        FT_UINT16, BASE_HEX, NULL, 0x0,                                 \
2739
30
        "Encrypted ClientHello: ECHConfig version", HFILL }             \
2740
30
    },                                                                  \
2741
30
    { & name .hf.ech_echconfig_length,                                  \
2742
30
      { "Length", prefix ".ech.echconfig.length",                       \
2743
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2744
30
        "Encrypted ClientHello: ECHConfig length", HFILL }              \
2745
30
    },                                                                  \
2746
30
    { & name .hf.ech_echconfigcontents_maximum_name_length,             \
2747
30
      { "Maximum Name Length", prefix ".ech.echconfigcontents.maximum_name_length", \
2748
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2749
30
        "The longest name of a backend server, if known", HFILL }       \
2750
30
    },                                                                  \
2751
30
    { & name .hf.ech_echconfigcontents_public_name_length,              \
2752
30
      { "Public Name length", prefix ".ech.echconfigcontents.public_name_length", \
2753
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2754
30
        "Length of the Public Name field", HFILL }                      \
2755
30
    },                                                                  \
2756
30
    { & name .hf.ech_echconfigcontents_public_name,                     \
2757
30
      { "Public Name", prefix ".ech.echconfigcontents.public_name",     \
2758
30
        FT_STRING, BASE_NONE, NULL, 0x0,                                \
2759
30
        "The DNS name of the client-facing server, i.e., the entity trusted to update the ECH configuration", HFILL } \
2760
30
    },                                                                  \
2761
30
    { & name .hf.ech_echconfigcontents_extensions_length,               \
2762
30
      { "Extensions length", prefix ".ech.echconfigcontents.extensions_length", \
2763
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2764
30
        "Length of the Extensions field", HFILL }                       \
2765
30
    },                                                                  \
2766
30
    { & name .hf.ech_echconfigcontents_extensions,                      \
2767
30
      { "Extensions", prefix ".ech.echconfigcontents.extensions",       \
2768
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2769
30
        "A list of extensions that the client must take into consideration when generating a ClientHello message", HFILL } \
2770
30
    },                                                                  \
2771
30
    { & name .hf.ech_hpke_keyconfig,                                    \
2772
30
      { "HPKE Key Config", prefix ".ech.hpke.keyconfig",                \
2773
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2774
30
        "HPKE Key Config", HFILL }                                      \
2775
30
    },                                                                  \
2776
30
    { & name .hf.ech_hpke_keyconfig_config_id,                          \
2777
30
      { "Config Id", prefix ".ech.hpke.keyconfig.config_id",            \
2778
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2779
30
        "HPKE Config Id", HFILL }                                       \
2780
30
    },                                                                  \
2781
30
    { & name .hf.ech_hpke_keyconfig_kem_id,                             \
2782
30
      { "KEM Id", prefix ".ech.hpke.keyconfig.kem_id",                  \
2783
30
        FT_UINT16, BASE_DEC, VALS(kem_id_type_vals), 0x0,               \
2784
30
        "HPKE KEM Id", HFILL }                                          \
2785
30
    },                                                                  \
2786
30
    { & name .hf.ech_hpke_keyconfig_public_key_length,                  \
2787
30
      { "Public Key length", prefix ".ech.hpke.keyconfig.public_key_length", \
2788
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2789
30
        "HPKE Public Key length", HFILL }                               \
2790
30
    },                                                                  \
2791
30
    { & name .hf.ech_hpke_keyconfig_public_key,                         \
2792
30
      { "Public Key", prefix ".ech.hpke.keyconfig.public_key",          \
2793
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2794
30
        "HPKE Public Key", HFILL }                                      \
2795
30
    },                                                                  \
2796
30
    { & name .hf.ech_hpke_keyconfig_cipher_suites,                      \
2797
30
      { "Cipher Suites", prefix ".ech.hpke.keyconfig.cipher_suites",    \
2798
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2799
30
        "HPKE Cipher Suites", HFILL }                                   \
2800
30
    },                                                                  \
2801
30
    { & name .hf.ech_hpke_keyconfig_cipher_suites_length,               \
2802
30
      { "Cipher Suites length", prefix ".ech.hpke.keyconfig.cipher_suites_length", \
2803
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2804
30
        "HPKE Cipher Suites length", HFILL }                            \
2805
30
    },                                                                  \
2806
30
    { & name .hf.ech_hpke_keyconfig_cipher_suite,                       \
2807
30
      { "Cipher Suite", prefix ".ech.hpke.keyconfig.cipher_suite",      \
2808
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2809
30
        "HPKE Cipher Suite", HFILL }                                    \
2810
30
    },                                                                  \
2811
30
    { & name .hf.ech_hpke_keyconfig_cipher_suite_kdf_id,                \
2812
30
      { "KDF Id", prefix ".ech.hpke.keyconfig.cipher_suite.kdf_id",     \
2813
30
        FT_UINT16, BASE_DEC, VALS(kdf_id_type_vals), 0x0,               \
2814
30
        "HPKE KDF Id", HFILL }                                          \
2815
30
    },                                                                  \
2816
30
    { & name .hf.ech_hpke_keyconfig_cipher_suite_aead_id,               \
2817
30
      { "AEAD Id", prefix ".ech.hpke.keyconfig.cipher_suite.aead_id",   \
2818
30
        FT_UINT16, BASE_DEC, VALS(aead_id_type_vals), 0x0,              \
2819
30
        "HPKE AEAD Id", HFILL }                                         \
2820
30
    },                                                                  \
2821
30
    { & name .hf.ech_clienthello_type,                                  \
2822
30
      { "Client Hello type", prefix ".ech.client_hello_type",           \
2823
30
        FT_UINT8, BASE_DEC, VALS(tls_hello_ext_ech_clienthello_types), 0x0, \
2824
30
        "Client Hello type", HFILL }                                     \
2825
30
    },                                                                  \
2826
30
    { & name .hf.ech_cipher_suite,                                      \
2827
30
      { "Cipher Suite", prefix ".ech.cipher_suite",                     \
2828
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2829
30
        "The cipher suite used to encrypt ClientHelloInner", HFILL }    \
2830
30
    },                                                                  \
2831
30
    { & name .hf.ech_config_id,                                         \
2832
30
      { "Config Id", prefix ".ech.config_id",                           \
2833
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2834
30
        "The ECHConfigContents.key_config.config_id for the chosen ECHConfig", HFILL } \
2835
30
    },                                                                  \
2836
30
    { & name .hf.ech_enc_length,                                        \
2837
30
      { "Enc length", prefix ".ech.enc_length",                         \
2838
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2839
30
        NULL, HFILL }                                                   \
2840
30
    },                                                                  \
2841
30
    { & name .hf.ech_enc,                                               \
2842
30
      { "Enc", prefix ".ech.enc",                                       \
2843
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2844
30
        "The HPKE encapsulated key, used by servers to decrypt the corresponding payload field", HFILL } \
2845
30
    },                                                                  \
2846
30
    { & name .hf.ech_payload_length,                                    \
2847
30
      { "Payload length", prefix ".ech.payload_length",                 \
2848
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2849
30
        "Payload Length", HFILL }                                       \
2850
30
    },                                                                  \
2851
30
    { & name .hf.ech_payload,                                           \
2852
30
      { "Payload", prefix ".ech.payload",                               \
2853
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2854
30
        "The serialized and encrypted ClientHelloInner structure", HFILL } \
2855
30
    },                                                                  \
2856
30
    { & name .hf.ech_confirmation,                                      \
2857
30
      { "Confirmation", prefix ".ech.confirmation",                     \
2858
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2859
30
        "Confirmation of ECH acceptance in a HelloRetryRequest", HFILL } \
2860
30
    },                                                                  \
2861
30
    { & name .hf.ech_retry_configs,                                     \
2862
30
      { "Retry Configs", prefix ".ech.retry_configs",                   \
2863
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2864
30
        "ECHConfig structures for one-time use by the client in a retry connection", HFILL } \
2865
30
    },                                                                  \
2866
30
    { & name .hf.ech_padding_data,                                      \
2867
30
      { "ECH Encrypted Padding", prefix ".ech.encrypted_padding",       \
2868
30
        FT_BYTES, BASE_NONE, NULL, 0x0,                                 \
2869
30
        "Must be zero", HFILL }                                         \
2870
30
    },                                                                  \
2871
30
    { & name .hf.hs_ext_alps_len,                                       \
2872
30
      { "ALPS Extension Length", prefix ".handshake.extensions_alps_len", \
2873
30
        FT_UINT16, BASE_DEC, NULL, 0x0,                                 \
2874
30
        "Length of the ALPS Extension", HFILL }                         \
2875
30
    },                                                                  \
2876
30
    { & name .hf.hs_ext_alps_alpn_list,                                 \
2877
30
      { "Supported ALPN List", prefix ".handshake.extensions_alps_alpn_list", \
2878
30
        FT_NONE, BASE_NONE, NULL, 0x0,                                  \
2879
30
        "List of supported ALPN by ALPS", HFILL }                       \
2880
30
    },                                                                  \
2881
30
    { & name .hf.hs_ext_alps_alpn_str_len,                              \
2882
30
      { "Supported ALPN Length", prefix ".handshake.extensions_alps_alpn_str_len", \
2883
30
        FT_UINT8, BASE_DEC, NULL, 0x0,                                  \
2884
30
        "Length of ALPN string", HFILL }                                \
2885
30
    },                                                                  \
2886
30
    { & name .hf.hs_ext_alps_alpn_str,                                  \
2887
30
      { "Supported ALPN", prefix ".handshake.extensions_alps_alpn_str", \
2888
30
        FT_STRING, BASE_NONE, NULL, 0x00,                               \
2889
30
        "ALPN supported by ALPS", HFILL }                               \
2890
30
    },                                                                  \
2891
30
    { & name .hf.hs_ext_alps_settings,                                  \
2892
30
      { "ALPN Opaque Settings", prefix ".handshake.extensions_alps.settings", \
2893
30
        FT_BYTES, BASE_NONE, NULL, 0x00,                                \
2894
30
        "ALPN Opaque Settings", HFILL }                                 \
2895
30
    }
2896
/* }}} */
2897
2898
/* {{{ */
2899
#define SSL_COMMON_ETT_LIST(name)                   \
2900
30
        & name .ett.hs_ext,                         \
2901
30
        & name .ett.hs_ext_alpn,                    \
2902
30
        & name .ett.hs_ext_cert_types,              \
2903
30
        & name .ett.hs_ext_groups,                  \
2904
30
        & name .ett.hs_ext_curves_point_formats,    \
2905
30
        & name .ett.hs_ext_npn,                     \
2906
30
        & name .ett.hs_ext_reneg_info,              \
2907
30
        & name .ett.hs_ext_key_share,               \
2908
30
        & name .ett.hs_ext_key_share_ks,            \
2909
30
        & name .ett.hs_ext_pre_shared_key,          \
2910
30
        & name .ett.hs_ext_psk_identity,            \
2911
30
        & name .ett.hs_ext_psk_binders,             \
2912
30
        & name .ett.hs_ext_psk_binder,              \
2913
30
        & name .ett.hs_ext_server_name,             \
2914
30
        & name .ett.hs_ext_oid_filter,              \
2915
30
        & name .ett.hs_ext_quictp_parameter,        \
2916
30
        & name .ett.hs_ext_trusted_ca_keys,         \
2917
30
        & name .ett.hs_ext_trusted_ca_key,          \
2918
30
        & name .ett.hs_sig_hash_alg,                \
2919
30
        & name .ett.hs_sig_hash_algs,               \
2920
30
        & name .ett.urlhash,                        \
2921
30
        & name .ett.keyex_params,                   \
2922
30
        & name .ett.certificates,                   \
2923
30
        & name .ett.cert_types,                     \
2924
30
        & name .ett.dnames,                         \
2925
30
        & name .ett.hs_random,                      \
2926
30
        & name .ett.cipher_suites,                  \
2927
30
        & name .ett.comp_methods,                   \
2928
30
        & name .ett.session_ticket,                 \
2929
30
        & name .ett.sct,                            \
2930
30
        & name .ett.cert_status,                    \
2931
30
        & name .ett.ocsp_response,                  \
2932
30
        & name .ett.uncompressed_certificates,      \
2933
30
        & name .ett.hs_ext_alps,                    \
2934
30
        & name .ett.ech_echconfiglist,              \
2935
30
        & name .ett.ech_echconfig,                  \
2936
30
        & name .ett.ech_retry_configs,              \
2937
30
        & name .ett.ech_hpke_keyconfig,             \
2938
30
        & name .ett.ech_hpke_cipher_suites,         \
2939
30
        & name .ett.ech_hpke_cipher_suite,          \
2940
30
        & name .ett.ech_decrypt,                    \
2941
30
        & name .ett.hs_ext_token_binding_key_parameters, \
2942
2943
/* }}} */
2944
2945
/* {{{ */
2946
#define SSL_COMMON_EI_LIST(name, prefix)                       \
2947
30
    { & name .ei.client_version_error, \
2948
30
        { prefix ".handshake.client_version_error", PI_PROTOCOL, PI_WARN, \
2949
30
        "Client Hello legacy version field specifies version 1.3, not version 1.2; some servers may not be able to handle that.", EXPFILL } \
2950
30
    }, \
2951
30
    { & name .ei.server_version_error, \
2952
30
        { prefix ".handshake.server_version_error", PI_PROTOCOL, PI_WARN, \
2953
30
        "Server Hello legacy version field specifies version 1.3, not version 1.2; some middleboxes may not be able to handle that.", EXPFILL } \
2954
30
    }, \
2955
30
    { & name .ei.legacy_version, \
2956
30
        { prefix ".handshake.legacy_version", PI_DEPRECATED, PI_CHAT, \
2957
30
        "This legacy_version field MUST be ignored. The supported_versions extension is present and MUST be used instead.", EXPFILL } \
2958
30
    }, \
2959
30
    { & name .ei.malformed_vector_length, \
2960
30
        { prefix ".malformed.vector_length", PI_PROTOCOL, PI_WARN, \
2961
30
        "Variable vector length is outside the permitted range", EXPFILL } \
2962
30
    }, \
2963
30
    { & name .ei.malformed_buffer_too_small, \
2964
30
        { prefix ".malformed.buffer_too_small", PI_MALFORMED, PI_ERROR, \
2965
30
        "Malformed message, not enough data is available", EXPFILL } \
2966
30
    }, \
2967
30
    { & name .ei.malformed_trailing_data, \
2968
30
        { prefix ".malformed.trailing_data", PI_PROTOCOL, PI_WARN, \
2969
30
        "Undecoded trailing data is present", EXPFILL } \
2970
30
    }, \
2971
30
    { & name .ei.hs_ext_cert_status_undecoded, \
2972
30
        { prefix ".handshake.status_request.undecoded", PI_UNDECODED, PI_NOTE, \
2973
30
        "Responder ID list or Request Extensions are not implemented", EXPFILL } \
2974
30
    }, \
2975
30
    { & name .ei.hs_ciphersuite_undecoded, \
2976
30
        { prefix ".handshake.ciphersuite.undecoded", PI_UNDECODED, PI_NOTE, \
2977
30
        "Ciphersuite not implemented", EXPFILL } \
2978
30
    }, \
2979
30
    { & name .ei.hs_srv_keyex_illegal, \
2980
30
        { prefix ".handshake.server_keyex_illegal", PI_PROTOCOL, PI_WARN, \
2981
30
        "It is not legal to send the ServerKeyExchange message for this ciphersuite", EXPFILL } \
2982
30
    }, \
2983
30
    { & name .ei.resumed, \
2984
30
        { prefix ".resumed", PI_SEQUENCE, PI_NOTE, \
2985
30
        "This session reuses previously negotiated keys (Session resumption)", EXPFILL } \
2986
30
    }, \
2987
30
    { & name .ei.record_length_invalid, \
2988
30
        { prefix ".record.length.invalid", PI_PROTOCOL, PI_ERROR, \
2989
30
        "Record fragment length is too small or too large", EXPFILL } \
2990
30
    }, \
2991
30
    { & name .ei.decompression_error, \
2992
30
        { prefix ".decompression_error", PI_PROTOCOL, PI_ERROR, \
2993
30
        "Decompression error", EXPFILL } \
2994
30
    }, \
2995
30
    { & name .ei.ech_echconfig_invalid_version, \
2996
30
        { prefix ".ech_echconfig_invalid_version", PI_PROTOCOL, PI_ERROR, \
2997
30
        "Invalid/unknown ECHConfig version", EXPFILL } \
2998
30
    }, \
2999
30
    { & name .ei.ech_accepted, \
3000
30
        { prefix ".ech_accepted", PI_PROTOCOL, PI_NOTE, \
3001
30
        "Calculated ECH Confirmation matches Server Random bytes, ECH was accepted", EXPFILL } \
3002
30
    }, \
3003
30
    { & name .ei.ech_rejected, \
3004
30
        { prefix ".ech_rejected", PI_PROTOCOL, PI_WARN, \
3005
30
        "Calculated ECH Confirmation does not match Server Random bytes, ECH was rejected", EXPFILL } \
3006
30
    }
3007
/* }}} */
3008
3009
extern void
3010
ssl_common_register_ssl_alpn_dissector_table(const char *name,
3011
    const char *ui_name, const int proto);
3012
3013
extern void
3014
ssl_common_register_dtls_alpn_dissector_table(const char *name,
3015
    const char *ui_name, const int proto);
3016
3017
extern void
3018
ssl_common_register_options(module_t *module, ssl_common_options_t *options, bool is_dtls);
3019
3020
#ifdef SSL_DECRYPT_DEBUG
3021
extern void
3022
ssl_debug_printf(const char* fmt,...) G_GNUC_PRINTF(1,2);
3023
extern void
3024
ssl_print_data(const char* name, const unsigned char* data, size_t len);
3025
extern void
3026
ssl_print_string(const char* name, const StringInfo* data);
3027
extern void
3028
ssl_set_debug(const char* name);
3029
extern void
3030
ssl_debug_flush(void);
3031
#else
3032
3033
/* No debug: nullify debug operation*/
3034
static inline void G_GNUC_PRINTF(1,2)
3035
ssl_debug_printf(const char* fmt _U_,...)
3036
{
3037
}
3038
#define ssl_print_data(a, b, c)
3039
#define ssl_print_string(a, b)
3040
#define ssl_set_debug(name)
3041
#define ssl_debug_flush()
3042
3043
#endif /* SSL_DECRYPT_DEBUG */
3044
3045
3046
uint32_t
3047
ssl_dissect_ext_ech_echconfiglist(ssl_common_dissect_t *hf, tvbuff_t *tvb, packet_info *pinfo,
3048
                                  proto_tree *tree, uint32_t offset, uint32_t offset_end);
3049
3050
#endif /* __PACKET_TLS_UTILS_H__ */
3051
3052
/*
3053
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
3054
 *
3055
 * Local variables:
3056
 * c-basic-offset: 4
3057
 * tab-width: 8
3058
 * indent-tabs-mode: nil
3059
 * End:
3060
 *
3061
 * vi: set shiftwidth=4 tabstop=8 expandtab:
3062
 * :indentSize=4:tabSize=8:noTabs=true:
3063
 */