Coverage Report

Created: 2026-11-12 07:01

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