| File: | builds/wireshark/wireshark/epan/dissectors/packet-dtls.c |
| Warning: | line 2658, column 12 Branch condition evaluates to a garbage value |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 1 | /* packet-dtls.c | |||
| 2 | * Routines for dtls dissection | |||
| 3 | * Copyright (c) 2006, Authesserre Samuel <sauthess@gmail.com> | |||
| 4 | * Copyright (c) 2007, Mikael Magnusson <mikma@users.sourceforge.net> | |||
| 5 | * Copyright (c) 2013, Hauke Mehrtens <hauke@hauke-m.de> | |||
| 6 | * | |||
| 7 | * Wireshark - Network traffic analyzer | |||
| 8 | * By Gerald Combs <gerald@wireshark.org> | |||
| 9 | * Copyright 1998 Gerald Combs | |||
| 10 | * | |||
| 11 | * SPDX-License-Identifier: GPL-2.0-or-later | |||
| 12 | * | |||
| 13 | * | |||
| 14 | * DTLS dissection and decryption. | |||
| 15 | * See RFC 4347 for details about DTLS specs. | |||
| 16 | * | |||
| 17 | * Notes : | |||
| 18 | * This dissector is based on the TLS dissector (packet-tls.c); Because of the similarity | |||
| 19 | * of DTLS and TLS, decryption works like TLS with RSA key exchange. | |||
| 20 | * This dissector uses the sames things (file, libraries) as the TLS dissector (gnutls, packet-tls-utils.h) | |||
| 21 | * to make it easily maintainable. | |||
| 22 | * | |||
| 23 | * It was developed to dissect and decrypt the OpenSSL v 0.9.8f DTLS implementation. | |||
| 24 | * It is limited to this implementation; there is no complete implementation. | |||
| 25 | * | |||
| 26 | * Implemented : | |||
| 27 | * - DTLS dissection | |||
| 28 | * - DTLS decryption (openssl one) | |||
| 29 | * | |||
| 30 | * Todo : | |||
| 31 | * - activate correct Mac calculation when openssl will be corrected | |||
| 32 | * (or if an other implementation works), | |||
| 33 | * corrected code is ready and commented in packet-tls-utils.h file. | |||
| 34 | * - add missing things (desegmentation, reordering... that aren't present in actual OpenSSL implementation) | |||
| 35 | */ | |||
| 36 | ||||
| 37 | #include "config.h" | |||
| 38 | ||||
| 39 | #include <epan/packet.h> | |||
| 40 | #include <epan/to_str.h> | |||
| 41 | #include <epan/asn1.h> | |||
| 42 | #include <epan/tap.h> | |||
| 43 | #include <epan/reassemble.h> | |||
| 44 | #include <epan/uat.h> | |||
| 45 | #include <epan/addr_resolv.h> | |||
| 46 | #include <epan/follow.h> | |||
| 47 | #include <epan/exported_pdu.h> | |||
| 48 | #include <epan/decode_as.h> | |||
| 49 | #include <epan/proto_data.h> | |||
| 50 | #include <epan/secrets.h> /* for privkey_hash_table_new */ | |||
| 51 | #include <epan/tfs.h> | |||
| 52 | #include <wsutil/str_util.h> | |||
| 53 | #include <wsutil/strtoi.h> | |||
| 54 | #include <wsutil/utf8_entities.h> | |||
| 55 | #include <wsutil/rsa.h> | |||
| 56 | #include <wsutil/pint.h> | |||
| 57 | #include "conversation.h" | |||
| 58 | #include "packet-tls-utils.h" | |||
| 59 | #include "packet-dtls.h" | |||
| 60 | #include "packet-rtp.h" | |||
| 61 | #include "packet-rtcp.h" | |||
| 62 | #include "packet-udp.h" | |||
| 63 | #include "packet-sctp.h" | |||
| 64 | ||||
| 65 | void proto_register_dtls(void); | |||
| 66 | ||||
| 67 | #ifdef HAVE_LIBGNUTLS1 | |||
| 68 | /* DTLS User Access Table */ | |||
| 69 | static ssldecrypt_assoc_t *dtlskeylist_uats; | |||
| 70 | static unsigned ndtlsdecrypt; | |||
| 71 | #endif | |||
| 72 | ||||
| 73 | /* we need to remember the top tree so that subdissectors we call are created | |||
| 74 | * at the root and not deep down inside the DTLS decode | |||
| 75 | */ | |||
| 76 | static proto_tree *top_tree; | |||
| 77 | ||||
| 78 | /********************************************************************* | |||
| 79 | * | |||
| 80 | * Protocol Constants, Variables, Data Structures | |||
| 81 | * | |||
| 82 | *********************************************************************/ | |||
| 83 | ||||
| 84 | /* https://www.iana.org/assignments/srtp-protection/srtp-protection.xhtml */ | |||
| 85 | ||||
| 86 | #define SRTP_PROFILE_RESERVED0x0000 0x0000 | |||
| 87 | #define SRTP_AES128_CM_HMAC_SHA1_800x0001 0x0001 | |||
| 88 | #define SRTP_AES128_CM_HMAC_SHA1_320x0002 0x0002 | |||
| 89 | #define SRTP_NULL_HMAC_SHA1_800x0005 0x0005 | |||
| 90 | #define SRTP_NULL_HMAC_SHA1_320x0006 0x0006 | |||
| 91 | #define SRTP_AEAD_AES_128_GCM0x0007 0x0007 | |||
| 92 | #define SRTP_AEAD_AES_256_GCM0x0008 0x0008 | |||
| 93 | #define DOUBLE_AEAD_AES_128_GCM_AEAD_AES_128_GCM0x0009 0x0009 | |||
| 94 | #define DOUBLE_AEAD_AES_256_GCM_AEAD_AES_256_GCM0x000A 0x000A | |||
| 95 | #define SRTP_ARIA_128_CTR_HMAC_SHA1_800x000B 0x000B | |||
| 96 | #define SRTP_ARIA_128_CTR_HMAC_SHA1_320x000C 0x000C | |||
| 97 | #define SRTP_ARIA_256_CTR_HMAC_SHA1_800x000D 0x000D | |||
| 98 | #define SRTP_ARIA_256_CTR_HMAC_SHA1_320x000E 0x000E | |||
| 99 | #define SRTP_AEAD_ARIA_128_GCM0x000F 0x000F | |||
| 100 | #define SRTP_AEAD_ARIA_256_GCM0x0010 0x0010 | |||
| 101 | ||||
| 102 | #define DTLS13_FIXED_MASK0xE0 0xE0 | |||
| 103 | #define DTLS13_C_BIT_MASK0x10 0x10 | |||
| 104 | #define DTLS13_S_BIT_MASK0x08 0x08 | |||
| 105 | #define DTLS13_L_BIT_MASK0x04 0x04 | |||
| 106 | #define DTLS13_HDR_EPOCH_BIT_MASK0x3 0x3 | |||
| 107 | ||||
| 108 | static const value_string srtp_protection_profile_vals[] = { | |||
| 109 | { SRTP_AES128_CM_HMAC_SHA1_800x0001, "SRTP_AES128_CM_HMAC_SHA1_80" }, /* RFC 5764 */ | |||
| 110 | { SRTP_AES128_CM_HMAC_SHA1_320x0002, "SRTP_AES128_CM_HMAC_SHA1_32" }, | |||
| 111 | { SRTP_NULL_HMAC_SHA1_800x0005, "SRTP_NULL_HMAC_SHA1_80" }, | |||
| 112 | { SRTP_NULL_HMAC_SHA1_320x0006, "SRTP_NULL_HMAC_SHA1_32" }, | |||
| 113 | { SRTP_AEAD_AES_128_GCM0x0007, "SRTP_AEAD_AES_128_GCM" }, /* RFC 7714 */ | |||
| 114 | { SRTP_AEAD_AES_256_GCM0x0008, "SRTP_AEAD_AES_256_GCM" }, | |||
| 115 | { DOUBLE_AEAD_AES_128_GCM_AEAD_AES_128_GCM0x0009, "DOUBLE_AEAD_AES_128_GCM_AEAD_AES_128_GCM" }, /* RFC 8723 */ | |||
| 116 | { DOUBLE_AEAD_AES_256_GCM_AEAD_AES_256_GCM0x000A, "DOUBLE_AEAD_AES_256_GCM_AEAD_AES_256_GCM" }, | |||
| 117 | { SRTP_ARIA_128_CTR_HMAC_SHA1_800x000B, "SRTP_ARIA_128_CTR_HMAC_SHA1_80" }, /* RFC 8269 */ | |||
| 118 | { SRTP_ARIA_128_CTR_HMAC_SHA1_320x000C, "SRTP_ARIA_128_CTR_HMAC_SHA1_32" }, | |||
| 119 | { SRTP_ARIA_256_CTR_HMAC_SHA1_800x000D, "SRTP_ARIA_256_CTR_HMAC_SHA1_80" }, | |||
| 120 | { SRTP_ARIA_256_CTR_HMAC_SHA1_320x000E, "SRTP_ARIA_256_CTR_HMAC_SHA1_32" }, | |||
| 121 | { SRTP_AEAD_ARIA_128_GCM0x000F, "SRTP_AEAD_ARIA_128_GCM" }, | |||
| 122 | { SRTP_AEAD_ARIA_256_GCM0x0010, "SRTP_AEAD_ARIA_256_GCM" }, | |||
| 123 | { 0x00, NULL((void*)0) }, | |||
| 124 | }; | |||
| 125 | ||||
| 126 | static const true_false_string dtls_uni_hdr_seq_tfs = { | |||
| 127 | "16 bits", | |||
| 128 | "8 bits" | |||
| 129 | }; | |||
| 130 | ||||
| 131 | /* Initialize the protocol and registered fields */ | |||
| 132 | static int dtls_tap; | |||
| 133 | static int dtls_follow_tap; | |||
| 134 | static int exported_pdu_tap; | |||
| 135 | static int proto_dtls; | |||
| 136 | static int hf_dtls_stream; | |||
| 137 | static int hf_dtls_record; | |||
| 138 | static int hf_dtls_record_content_type; | |||
| 139 | static int hf_dtls_record_special_type; | |||
| 140 | static int hf_dtls_record_version; | |||
| 141 | static int hf_dtls_ack_record_numbers; | |||
| 142 | static int hf_dtls_record_epoch; | |||
| 143 | static int hf_dtls_record_epoch64; | |||
| 144 | static int hf_dtls_record_sequence_number; | |||
| 145 | static int hf_dtls_record_sequence_suffix; | |||
| 146 | static int hf_dtls_record_sequence_suffix_dec; | |||
| 147 | static int hf_dtls_record_connection_id; | |||
| 148 | static int hf_dtls_record_length; | |||
| 149 | static int hf_dtls_record_appdata; | |||
| 150 | static int hf_dtls_record_appdata_proto; | |||
| 151 | static int hf_dtls_record_encrypted_content; | |||
| 152 | static int hf_dtls_alert_message; | |||
| 153 | static int hf_dtls_alert_message_level; | |||
| 154 | static int hf_dtls_alert_message_description; | |||
| 155 | static int hf_dtls_handshake_protocol; | |||
| 156 | static int hf_dtls_handshake_type; | |||
| 157 | static int hf_dtls_handshake_length; | |||
| 158 | static int hf_dtls_handshake_message_seq; | |||
| 159 | static int hf_dtls_handshake_fragment_offset; | |||
| 160 | static int hf_dtls_handshake_fragment_length; | |||
| 161 | ||||
| 162 | static int hf_dtls_heartbeat_message; | |||
| 163 | static int hf_dtls_heartbeat_message_type; | |||
| 164 | static int hf_dtls_heartbeat_message_payload_length; | |||
| 165 | static int hf_dtls_heartbeat_message_payload; | |||
| 166 | static int hf_dtls_heartbeat_message_padding; | |||
| 167 | ||||
| 168 | static int hf_dtls_ack_message; | |||
| 169 | static int hf_dtls_ack_record_numbers_length; | |||
| 170 | static int hf_dtls_fragments; | |||
| 171 | static int hf_dtls_fragment; | |||
| 172 | static int hf_dtls_fragment_overlap; | |||
| 173 | static int hf_dtls_fragment_overlap_conflicts; | |||
| 174 | static int hf_dtls_fragment_multiple_tails; | |||
| 175 | static int hf_dtls_fragment_too_long_fragment; | |||
| 176 | static int hf_dtls_fragment_error; | |||
| 177 | static int hf_dtls_fragment_count; | |||
| 178 | static int hf_dtls_reassembled_in; | |||
| 179 | static int hf_dtls_reassembled_length; | |||
| 180 | ||||
| 181 | static int hf_dtls_hs_ext_use_srtp_protection_profiles_length; | |||
| 182 | static int hf_dtls_hs_ext_use_srtp_protection_profile; | |||
| 183 | static int hf_dtls_hs_ext_use_srtp_mki_length; | |||
| 184 | static int hf_dtls_hs_ext_use_srtp_mki; | |||
| 185 | ||||
| 186 | static int hf_dtls_uni_hdr; | |||
| 187 | static int hf_dtls_uni_hdr_fixed; | |||
| 188 | static int hf_dtls_uni_hdr_cid; | |||
| 189 | static int hf_dtls_uni_hdr_seq; | |||
| 190 | static int hf_dtls_uni_hdr_len; | |||
| 191 | static int hf_dtls_uni_hdr_epoch; | |||
| 192 | ||||
| 193 | /* header fields used in ssl-utils, but defined here. */ | |||
| 194 | static dtls_hfs_t dtls_hfs; | |||
| 195 | ||||
| 196 | /* Initialize the subtree pointers */ | |||
| 197 | static int ett_dtls; | |||
| 198 | static int ett_dtls_record; | |||
| 199 | static int ett_dtls_alert; | |||
| 200 | static int ett_dtls_handshake; | |||
| 201 | static int ett_dtls_heartbeat; | |||
| 202 | static int ett_dtls_ack; | |||
| 203 | static int ett_dtls_ack_record_numbers; | |||
| 204 | static int ett_dtls_ack_record_number; | |||
| 205 | static int ett_dtls_certs; | |||
| 206 | static int ett_dtls_uni_hdr; | |||
| 207 | ||||
| 208 | static int ett_dtls_fragment; | |||
| 209 | static int ett_dtls_fragments; | |||
| 210 | ||||
| 211 | static expert_field ei_dtls_handshake_fragment_length_too_long; | |||
| 212 | static expert_field ei_dtls_handshake_fragment_length_zero; | |||
| 213 | static expert_field ei_dtls_handshake_too_many_fragments; | |||
| 214 | static expert_field ei_dtls_handshake_fragment_past_end_msg; | |||
| 215 | static expert_field ei_dtls_msg_len_diff_fragment; | |||
| 216 | static expert_field ei_dtls_heartbeat_payload_length; | |||
| 217 | static expert_field ei_dtls_cid_invalid_content_type; | |||
| 218 | static expert_field ei_dtls_use_srtp_profiles_length; | |||
| 219 | #if 0 | |||
| 220 | static expert_field ei_dtls_cid_invalid_enc_content; | |||
| 221 | #endif | |||
| 222 | ||||
| 223 | #ifdef HAVE_LIBGNUTLS1 | |||
| 224 | static GHashTable *dtls_key_hash; | |||
| 225 | static wmem_stack_t *key_list_stack; | |||
| 226 | static uat_t *dtlsdecrypt_uat; | |||
| 227 | #endif | |||
| 228 | static reassembly_table dtls_reassembly_table; | |||
| 229 | static dissector_table_t dtls_associations; | |||
| 230 | static dissector_handle_t dtls_handle; | |||
| 231 | static StringInfo dtls_compressed_data; | |||
| 232 | static StringInfo dtls_decrypted_data; | |||
| 233 | static unsigned dtls_decrypted_data_avail; | |||
| 234 | ||||
| 235 | static ssl_common_options_t dtls_options; | |||
| 236 | static const char *dtls_debug_file_name; | |||
| 237 | ||||
| 238 | static uint32_t dtls_default_client_cid_length; | |||
| 239 | static uint32_t dtls_default_server_cid_length; | |||
| 240 | ||||
| 241 | static heur_dissector_list_t heur_subdissector_list; | |||
| 242 | ||||
| 243 | static uint32_t dtls_stream_count; | |||
| 244 | ||||
| 245 | static const fragment_items dtls_frag_items = { | |||
| 246 | /* Fragment subtrees */ | |||
| 247 | &ett_dtls_fragment, | |||
| 248 | &ett_dtls_fragments, | |||
| 249 | /* Fragment fields */ | |||
| 250 | &hf_dtls_fragments, | |||
| 251 | &hf_dtls_fragment, | |||
| 252 | &hf_dtls_fragment_overlap, | |||
| 253 | &hf_dtls_fragment_overlap_conflicts, | |||
| 254 | &hf_dtls_fragment_multiple_tails, | |||
| 255 | &hf_dtls_fragment_too_long_fragment, | |||
| 256 | &hf_dtls_fragment_error, | |||
| 257 | &hf_dtls_fragment_count, | |||
| 258 | /* Reassembled in field */ | |||
| 259 | &hf_dtls_reassembled_in, | |||
| 260 | /* Reassembled length field */ | |||
| 261 | &hf_dtls_reassembled_length, | |||
| 262 | /* Reassembled data field */ | |||
| 263 | NULL((void*)0), | |||
| 264 | /* Tag */ | |||
| 265 | "Message fragments" | |||
| 266 | }; | |||
| 267 | ||||
| 268 | static SSL_COMMON_LIST_T(dissect_dtls_hf)ssl_common_dissect_t dissect_dtls_hf; | |||
| 269 | ||||
| 270 | static uint32_t get_dtls_stream_count(void) | |||
| 271 | { | |||
| 272 | return dtls_stream_count; | |||
| 273 | } | |||
| 274 | ||||
| 275 | uint32_t dtls_increment_stream_count(void) | |||
| 276 | { | |||
| 277 | return dtls_stream_count++; | |||
| 278 | } | |||
| 279 | ||||
| 280 | /* initialize/reset per capture state data (dtls sessions cache) */ | |||
| 281 | static void | |||
| 282 | dtls_init(void) | |||
| 283 | { | |||
| 284 | ssl_data_alloc(&dtls_decrypted_data, 32); | |||
| 285 | ssl_data_alloc(&dtls_compressed_data, 32); | |||
| 286 | ||||
| 287 | ssl_init_cid_list(); | |||
| 288 | ||||
| 289 | dtls_stream_count = 0; | |||
| 290 | } | |||
| 291 | ||||
| 292 | static void | |||
| 293 | dtls_cleanup(void) | |||
| 294 | { | |||
| 295 | ssl_cleanup_cid_list(); | |||
| 296 | ||||
| 297 | #ifdef HAVE_LIBGNUTLS1 | |||
| 298 | if (key_list_stack != NULL((void*)0)) { | |||
| 299 | wmem_destroy_stack(key_list_stack)wmem_destroy_list(key_list_stack); | |||
| 300 | key_list_stack = NULL((void*)0); | |||
| 301 | } | |||
| 302 | #endif | |||
| 303 | g_free(dtls_decrypted_data.data)(__builtin_object_size ((dtls_decrypted_data.data), 0) != ((size_t ) - 1)) ? g_free_sized (dtls_decrypted_data.data, __builtin_object_size ((dtls_decrypted_data.data), 0)) : (g_free) (dtls_decrypted_data .data); | |||
| 304 | g_free(dtls_compressed_data.data)(__builtin_object_size ((dtls_compressed_data.data), 0) != (( size_t) - 1)) ? g_free_sized (dtls_compressed_data.data, __builtin_object_size ((dtls_compressed_data.data), 0)) : (g_free) (dtls_compressed_data .data); | |||
| 305 | } | |||
| 306 | ||||
| 307 | #ifdef HAVE_LIBGNUTLS1 | |||
| 308 | /* parse dtls related preferences (private keys and ports association strings) */ | |||
| 309 | static void | |||
| 310 | dtls_parse_uat(void) | |||
| 311 | { | |||
| 312 | unsigned i, port; | |||
| 313 | dissector_handle_t handle; | |||
| 314 | ||||
| 315 | if (dtls_key_hash) | |||
| 316 | { | |||
| 317 | g_hash_table_destroy(dtls_key_hash); | |||
| 318 | } | |||
| 319 | ||||
| 320 | /* remove only associations created from key list */ | |||
| 321 | if (key_list_stack != NULL((void*)0)) { | |||
| 322 | while (wmem_stack_count(key_list_stack)wmem_list_count(key_list_stack) > 0) { | |||
| 323 | port = GPOINTER_TO_UINT(wmem_stack_pop(key_list_stack))((guint) (gulong) (wmem_stack_pop(key_list_stack))); | |||
| 324 | handle = dissector_get_uint_handle(dtls_associations, port); | |||
| 325 | if (handle != NULL((void*)0)) | |||
| 326 | ssl_association_remove("dtls.port", dtls_handle, handle, port, false0); | |||
| 327 | } | |||
| 328 | } | |||
| 329 | ||||
| 330 | /* parse private keys string, load available keys and put them in key hash*/ | |||
| 331 | dtls_key_hash = privkey_hash_table_new(); | |||
| 332 | ||||
| 333 | ssl_set_debug(dtls_debug_file_name); | |||
| 334 | ||||
| 335 | if (ndtlsdecrypt > 0) | |||
| 336 | { | |||
| 337 | if (key_list_stack == NULL((void*)0)) | |||
| 338 | key_list_stack = wmem_stack_new(NULL)wmem_list_new(((void*)0)); | |||
| 339 | ||||
| 340 | for (i = 0; i < ndtlsdecrypt; i++) | |||
| 341 | { | |||
| 342 | ssldecrypt_assoc_t *d = &(dtlskeylist_uats[i]); | |||
| 343 | ssl_parse_key_list(d, dtls_key_hash, "dtls.port", dtls_handle, false0); | |||
| 344 | if (key_list_stack && ws_strtou32(d->port, NULL((void*)0), &port)) | |||
| 345 | wmem_stack_push(key_list_stack, GUINT_TO_POINTER(port))wmem_list_prepend((key_list_stack), (((gpointer) (gulong) (port )))); | |||
| 346 | } | |||
| 347 | } | |||
| 348 | ||||
| 349 | dissector_add_for_decode_as("sctp.port", dtls_handle); | |||
| 350 | dissector_add_for_decode_as("udp.port", dtls_handle); | |||
| 351 | } | |||
| 352 | ||||
| 353 | static void | |||
| 354 | dtls_reset_uat(void) | |||
| 355 | { | |||
| 356 | g_hash_table_destroy(dtls_key_hash); | |||
| 357 | dtls_key_hash = NULL((void*)0); | |||
| 358 | } | |||
| 359 | #endif /* HAVE_LIBGNUTLS */ | |||
| 360 | ||||
| 361 | /* | |||
| 362 | * DTLS Dissection Routines | |||
| 363 | * | |||
| 364 | */ | |||
| 365 | ||||
| 366 | /* record layer dissectors */ | |||
| 367 | static int dissect_dtls_record(tvbuff_t *tvb, packet_info *pinfo, | |||
| 368 | proto_tree *tree, uint32_t offset, | |||
| 369 | SslSession *session, int is_from_server, | |||
| 370 | SslDecryptSession *conv_data, | |||
| 371 | uint8_t curr_layer_num_ssl); | |||
| 372 | static int dissect_dtls13_record(tvbuff_t *tvb, packet_info *pinfo, | |||
| 373 | proto_tree *tree, uint32_t offset, | |||
| 374 | SslSession *session, int is_from_server, | |||
| 375 | SslDecryptSession *conv_data, | |||
| 376 | uint8_t curr_layer_num_ssl); | |||
| 377 | ||||
| 378 | /* alert message dissector */ | |||
| 379 | static void dissect_dtls_alert(tvbuff_t *tvb, packet_info *pinfo, | |||
| 380 | proto_tree *tree, uint32_t offset, | |||
| 381 | const SslSession *session); | |||
| 382 | ||||
| 383 | /* handshake protocol dissector */ | |||
| 384 | static void dissect_dtls_handshake(tvbuff_t *tvb, packet_info *pinfo, | |||
| 385 | proto_tree *tree, uint32_t offset, | |||
| 386 | uint32_t record_length, bool_Bool maybe_encrypted, | |||
| 387 | SslSession *session, int is_from_server, | |||
| 388 | SslDecryptSession *conv_data, uint8_t content_type, | |||
| 389 | uint16_t epoch); | |||
| 390 | ||||
| 391 | /* heartbeat message dissector */ | |||
| 392 | static void dissect_dtls_heartbeat(tvbuff_t *tvb, packet_info *pinfo, | |||
| 393 | proto_tree *tree, uint32_t offset, | |||
| 394 | const SslSession *session, uint32_t record_length, | |||
| 395 | bool_Bool decrypted); | |||
| 396 | ||||
| 397 | /* acknowledgement message dissector */ | |||
| 398 | static void dissect_dtls_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t offset, uint32_t record_length); | |||
| 399 | ||||
| 400 | static int dissect_dtls_hnd_hello_verify_request(ssl_common_dissect_t *hf, tvbuff_t *tvb, | |||
| 401 | packet_info *pinfo, proto_tree *tree, | |||
| 402 | uint32_t offset, uint32_t offset_end); | |||
| 403 | ||||
| 404 | /* | |||
| 405 | * Support Functions | |||
| 406 | * | |||
| 407 | */ | |||
| 408 | ||||
| 409 | static int looks_like_dtls(tvbuff_t *tvb, uint32_t offset); | |||
| 410 | ||||
| 411 | /********************************************************************* | |||
| 412 | * | |||
| 413 | * Follow Stream support | |||
| 414 | * | |||
| 415 | *********************************************************************/ | |||
| 416 | ||||
| 417 | static char * | |||
| 418 | dtls_follow_conv_filter(epan_dissect_t *edt _U___attribute__((unused)), packet_info *pinfo, unsigned *stream, unsigned *sub_stream _U___attribute__((unused))) | |||
| 419 | { | |||
| 420 | char *filter = NULL((void*)0); | |||
| 421 | const SslPacketInfo *pi = NULL((void*)0); | |||
| 422 | uint8_t max_layer_num = proto_get_layer_num(pinfo, proto_dtls); | |||
| 423 | ||||
| 424 | for (uint8_t curr_layer_num = max_layer_num; curr_layer_num; --curr_layer_num) { | |||
| 425 | /* The (nesting) layer number in p_get_proto_data is 0-indexed. */ | |||
| 426 | pi = p_get_proto_data(wmem_file_scope(), pinfo, proto_dtls, curr_layer_num - 1); | |||
| 427 | if (pi) { | |||
| 428 | *stream = pi->stream; | |||
| 429 | filter = ws_strdup_printf("dtls.stream eq %u", *stream)wmem_strdup_printf(((void*)0), "dtls.stream eq %u", *stream); | |||
| 430 | break; | |||
| 431 | } | |||
| 432 | } | |||
| 433 | ||||
| 434 | return filter; | |||
| 435 | } | |||
| 436 | ||||
| 437 | static char * | |||
| 438 | dtls_follow_index_filter(unsigned stream, unsigned sub_stream _U___attribute__((unused))) | |||
| 439 | { | |||
| 440 | return ws_strdup_printf("dtls.stream eq %u", stream)wmem_strdup_printf(((void*)0), "dtls.stream eq %u", stream); | |||
| 441 | } | |||
| 442 | ||||
| 443 | /********************************************************************* | |||
| 444 | * | |||
| 445 | * Main dissector | |||
| 446 | * | |||
| 447 | *********************************************************************/ | |||
| 448 | /* | |||
| 449 | * Code to actually dissect the packets | |||
| 450 | */ | |||
| 451 | static int | |||
| 452 | dissect_dtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U___attribute__((unused))) | |||
| 453 | { | |||
| 454 | ||||
| 455 | conversation_t *conversation; | |||
| 456 | proto_item *ti; | |||
| 457 | proto_tree *dtls_tree; | |||
| 458 | uint32_t offset; | |||
| 459 | SslDecryptSession *ssl_session = NULL((void*)0); | |||
| 460 | SslSession *session = NULL((void*)0); | |||
| 461 | int is_from_server; | |||
| 462 | uint8_t curr_layer_num_ssl = p_get_proto_depth(pinfo, proto_dtls); | |||
| 463 | ||||
| 464 | ti = NULL((void*)0); | |||
| 465 | dtls_tree = NULL((void*)0); | |||
| 466 | offset = 0; | |||
| 467 | ssl_session = NULL((void*)0); | |||
| 468 | top_tree = tree; | |||
| 469 | ||||
| 470 | /* Track the version using conversations allows | |||
| 471 | * us to more frequently set the protocol column properly | |||
| 472 | * for continuation data frames. | |||
| 473 | * | |||
| 474 | * Also: We use the copy in conv_version as our cached copy, | |||
| 475 | * so that we don't have to search the conversation | |||
| 476 | * table every time we want the version; when setting | |||
| 477 | * the conv_version, must set the copy in the conversation | |||
| 478 | * in addition to conv_version | |||
| 479 | */ | |||
| 480 | conversation = find_or_create_conversation(pinfo); | |||
| 481 | ||||
| 482 | uint8_t record_type = tvb_get_uint8(tvb, offset); | |||
| 483 | ||||
| 484 | /* try to get decrypt session from the connection ID only for the first pass, | |||
| 485 | * it should be available from the conversation in the second pass | |||
| 486 | */ | |||
| 487 | if (record_type == SSL_ID_TLS12_CID && !PINFO_FD_VISITED(pinfo)((pinfo)->fd->visited)) { | |||
| 488 | // CID length is not embedded in the packet | |||
| 489 | ssl_session = ssl_get_session_by_cid(tvb, offset+11); | |||
| 490 | ||||
| 491 | if (ssl_session) { | |||
| 492 | /* Update conversation - get or create the wmem map. | |||
| 493 | * Using wmem_file_scope ensures the map is freed on capture reload. */ | |||
| 494 | void *conv_data = conversation_get_proto_data(conversation, dissector_handle_get_protocol_index(dtls_handle)); | |||
| 495 | wmem_map_t *session_map; | |||
| 496 | ||||
| 497 | if (conv_data == NULL((void*)0)) { | |||
| 498 | session_map = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); | |||
| 499 | conversation_add_proto_data(conversation, dissector_handle_get_protocol_index(dtls_handle), session_map); | |||
| 500 | } else { | |||
| 501 | session_map = (wmem_map_t *)conv_data; | |||
| 502 | } | |||
| 503 | ||||
| 504 | wmem_map_insert(session_map, GUINT_TO_POINTER((unsigned)curr_layer_num_ssl)((gpointer) (gulong) ((unsigned)curr_layer_num_ssl)), ssl_session); | |||
| 505 | } | |||
| 506 | } | |||
| 507 | ||||
| 508 | /* if session cannot be retrieved from connection ID, get or create it from conversation */ | |||
| 509 | if (ssl_session == NULL((void*)0)) { | |||
| 510 | ssl_session = ssl_get_session(conversation, dtls_handle, curr_layer_num_ssl); | |||
| 511 | } | |||
| 512 | ||||
| 513 | session = &ssl_session->session; | |||
| 514 | ||||
| 515 | if (session->last_nontls_frame != 0 && | |||
| 516 | session->last_nontls_frame >= pinfo->num) { | |||
| 517 | /* This conversation started at a different protocol and STARTTLS was | |||
| 518 | * used, but this packet comes too early. | |||
| 519 | * XXX - Does anything use STARTTLS with DTLS? Would we get here anyway, | |||
| 520 | * since we don't call conversation_set_dissector[_from_frame_number] for | |||
| 521 | * DTLS? Regardless, dissect_dtls_heur should check for this 0 and return | |||
| 522 | * false. | |||
| 523 | */ | |||
| 524 | return 0; | |||
| 525 | } | |||
| 526 | ||||
| 527 | ssl_debug_printf("\ndissect_dtls enter frame #%u (%s)\n", pinfo->num, pinfo->fd->visited ? "already visited" : "first time"); | |||
| 528 | is_from_server = ssl_packet_from_server(session, dtls_associations, pinfo); | |||
| 529 | ||||
| 530 | /* try decryption only the first time we see this packet | |||
| 531 | * (to keep cipher synchronized) */ | |||
| 532 | if (pinfo->fd->visited) | |||
| 533 | ssl_session = NULL((void*)0); | |||
| 534 | ||||
| 535 | /* Increment the proto depth, so any nested DTLS gets the new depth. | |||
| 536 | * Make sure to decrement when leaving the function. | |||
| 537 | * (XXX - Do we need a TRY...FINALLY or CLEANUP_CB_PUSH?) */ | |||
| 538 | p_set_proto_depth(pinfo, proto_dtls, curr_layer_num_ssl + 1); | |||
| 539 | ||||
| 540 | /* Initialize the protocol column; we'll set it later when we | |||
| 541 | * figure out what flavor of DTLS it is */ | |||
| 542 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "DTLS"); | |||
| 543 | ||||
| 544 | /* clear the info column */ | |||
| 545 | col_clear(pinfo->cinfo, COL_INFO); | |||
| 546 | ||||
| 547 | /* Create display subtree for SSL as a whole */ | |||
| 548 | ti = proto_tree_add_item(tree, proto_dtls, tvb, 0, -1, ENC_NA0x00000000); | |||
| 549 | dtls_tree = proto_item_add_subtree(ti, ett_dtls); | |||
| 550 | ||||
| 551 | ti = proto_tree_add_uint(dtls_tree, hf_dtls_stream, tvb, 0, 0, session->stream); | |||
| 552 | proto_item_set_generated(ti); | |||
| 553 | ||||
| 554 | /* iterate through the records in this tvbuff */ | |||
| 555 | while (tvb_reported_length_remaining(tvb, offset) != 0) | |||
| 556 | { | |||
| 557 | /* first try to dispatch off the cached version | |||
| 558 | * known to be associated with the conversation | |||
| 559 | * | |||
| 560 | * In fact, all versions of DTLS have the same dissector. Note as | |||
| 561 | * we don't set DTLS as the conversation dissector, either | |||
| 562 | * looks_like_dtls() passed in dissect_dtls_heur(), or this has | |||
| 563 | * been set to DTLS explicitly via the port or some other method, | |||
| 564 | * so we already think this is DTLS. We don't expect Continuation | |||
| 565 | * Data over UDP datagrams (unlike TCP segments), but we'll check | |||
| 566 | * the content type in dissect_dtls_record and mark as Continuation | |||
| 567 | * Data if an unknown type, so the only thing calling looks_like_dtls() | |||
| 568 | * here would do is additionally verify the legacy_record_version - | |||
| 569 | * which MUST be ignored for all purposes per RFC 9147. | |||
| 570 | */ | |||
| 571 | switch(session->version) { | |||
| 572 | case DTLSV1DOT0_VERSION0xfeff: | |||
| 573 | case DTLSV1DOT0_OPENSSL_VERSION0x100: | |||
| 574 | case DTLSV1DOT2_VERSION0xfefd: | |||
| 575 | case DTLSV1DOT3_VERSION0xfefc: | |||
| 576 | default: | |||
| 577 | offset = dissect_dtls_record(tvb, pinfo, dtls_tree, | |||
| 578 | offset, session, is_from_server, | |||
| 579 | ssl_session, curr_layer_num_ssl); | |||
| 580 | break; | |||
| 581 | } | |||
| 582 | } | |||
| 583 | ||||
| 584 | // XXX Is this tap needed? | |||
| 585 | tap_queue_packet(dtls_tap, pinfo, NULL((void*)0)); | |||
| 586 | tap_queue_packet(dtls_follow_tap, pinfo, p_get_proto_data(wmem_file_scope(), pinfo, proto_dtls, curr_layer_num_ssl)); | |||
| 587 | p_set_proto_depth(pinfo, proto_dtls, curr_layer_num_ssl); | |||
| 588 | return tvb_captured_length(tvb); | |||
| 589 | } | |||
| 590 | ||||
| 591 | static uint8_t dtls_cid_length(SslSession *session, bool_Bool is_from_server) | |||
| 592 | { | |||
| 593 | uint8_t cid_length; | |||
| 594 | ||||
| 595 | if (is_from_server) { | |||
| 596 | if (session && session->client_cid_len_present) { | |||
| 597 | cid_length = session->client_cid_len; | |||
| 598 | } else { | |||
| 599 | cid_length = (uint8_t)dtls_default_client_cid_length; | |||
| 600 | } | |||
| 601 | } else { | |||
| 602 | if (session && session->server_cid_len_present) { | |||
| 603 | cid_length = session->server_cid_len; | |||
| 604 | } else { | |||
| 605 | cid_length = (uint8_t)dtls_default_server_cid_length; | |||
| 606 | } | |||
| 607 | } | |||
| 608 | ||||
| 609 | return cid_length; | |||
| 610 | } | |||
| 611 | ||||
| 612 | static bool_Bool | |||
| 613 | dissect_dtls_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) | |||
| 614 | ||||
| 615 | { | |||
| 616 | /* Stronger confirmation of DTLS packet is provided by verifying the | |||
| 617 | * captured payload length against the remainder of the UDP packet size. */ | |||
| 618 | unsigned length = tvb_captured_length(tvb); | |||
| 619 | unsigned offset = 0; | |||
| 620 | unsigned record_length; | |||
| 621 | SslDecryptSession *ssl_session = NULL((void*)0); | |||
| 622 | SslSession *session = NULL((void*)0); | |||
| 623 | ||||
| 624 | if (tvb_reported_length(tvb) == length) { | |||
| 625 | /* The entire payload was captured. */ | |||
| 626 | while (offset + 13 <= length && looks_like_dtls(tvb, offset)) { | |||
| 627 | /* Advance offset to the end of the current DTLS record */ | |||
| 628 | uint8_t record_type = tvb_get_uint8(tvb, offset); | |||
| 629 | ||||
| 630 | if ((record_type & DTLS13_FIXED_MASK0xE0) >> 5 == 1) { | |||
| 631 | offset += 1; | |||
| 632 | /* With the DTLS 1.3 Unified Header, the legacy_record_version | |||
| 633 | * field is encrypted, so our heuristics are weaker. Only accept | |||
| 634 | * the frame if we already have seen DTLS (with the correct CID, | |||
| 635 | * if the CID is included) on the connection. | |||
| 636 | * N.B. - We don't call conversation_set_dissector_from_frame_number | |||
| 637 | * like in packet-tls.c because DTLS is commonly multiplexed with | |||
| 638 | * SRTP/SRTCP/STUN/TURN/ZRTP per RFC 7983. (And now QUIC, RFC 9443.) | |||
| 639 | */ | |||
| 640 | if (record_type & DTLS13_C_BIT_MASK0x10) { | |||
| 641 | /* CID length is not embedded in the packet */ | |||
| 642 | ssl_session = ssl_get_session_by_cid(tvb, offset); | |||
| 643 | session = ssl_session ? &ssl_session->session : NULL((void*)0); | |||
| 644 | int is_from_server = ssl_packet_from_server(session, dtls_associations, pinfo); | |||
| 645 | offset += dtls_cid_length(session, is_from_server); | |||
| 646 | } else { | |||
| 647 | /* No CID, just look for a session on this conversation. Don't | |||
| 648 | * call ssl_get_session here, as we don't want to allocate a new | |||
| 649 | * session. */ | |||
| 650 | conversation_t *conversation = find_or_create_conversation(pinfo); | |||
| 651 | wmem_map_t *session_map = (wmem_map_t *)conversation_get_proto_data(conversation, proto_dtls); | |||
| 652 | ssl_session = session_map ? | |||
| 653 | (SslDecryptSession *)wmem_map_lookup(session_map, GUINT_TO_POINTER(p_get_proto_depth(pinfo, proto_dtls))((gpointer) (gulong) (p_get_proto_depth(pinfo, proto_dtls)))) : NULL((void*)0); | |||
| 654 | session = ssl_session ? &ssl_session->session : NULL((void*)0); | |||
| 655 | } | |||
| 656 | if (session == NULL((void*)0)) { | |||
| 657 | return false0; | |||
| 658 | } | |||
| 659 | offset += (record_type & DTLS13_S_BIT_MASK0x08) ? 2 : 1; | |||
| 660 | if (record_type & DTLS13_L_BIT_MASK0x04) { | |||
| 661 | record_length = tvb_get_ntohs(tvb, offset); | |||
| 662 | offset += 2; | |||
| 663 | } else { | |||
| 664 | /* Length not present, so the heuristic is weaker. */ | |||
| 665 | record_length = tvb_reported_length_remaining(tvb, offset); | |||
| 666 | } | |||
| 667 | } else { | |||
| 668 | offset += 11; | |||
| 669 | if (record_type == SSL_ID_TLS12_CID) { | |||
| 670 | /* CID length is not embedded in the packet */ | |||
| 671 | ssl_session = ssl_get_session_by_cid(tvb, offset); | |||
| 672 | session = ssl_session ? &ssl_session->session : NULL((void*)0); | |||
| 673 | int is_from_server = ssl_packet_from_server(session, dtls_associations, pinfo); | |||
| 674 | offset += dtls_cid_length(session, is_from_server); | |||
| 675 | } | |||
| 676 | record_length = tvb_get_ntohs(tvb, offset); | |||
| 677 | offset += 2; | |||
| 678 | } | |||
| 679 | offset += record_length; | |||
| 680 | if (offset == length) { | |||
| 681 | dissect_dtls(tvb, pinfo, tree, data); | |||
| 682 | return true1; | |||
| 683 | } | |||
| 684 | } | |||
| 685 | ||||
| 686 | if (pinfo->fragmented && offset >= 13) { | |||
| 687 | dissect_dtls(tvb, pinfo, tree, data); | |||
| 688 | return true1; | |||
| 689 | } | |||
| 690 | return false0; | |||
| 691 | } | |||
| 692 | ||||
| 693 | /* This packet was truncated by the capture process due to a snapshot | |||
| 694 | * length - do our best with what we've got. */ | |||
| 695 | while (tvb_captured_length_remaining(tvb, offset) >= 3) { | |||
| 696 | if (!looks_like_dtls(tvb, offset)) | |||
| 697 | return false0; | |||
| 698 | ||||
| 699 | offset += 3; | |||
| 700 | if (tvb_captured_length_remaining(tvb, offset) >= 10 ) { | |||
| 701 | offset += tvb_get_ntohs(tvb, offset + 8) + 10; | |||
| 702 | } else { | |||
| 703 | /* Dissect what we've got, which might be as little as 3 bytes. */ | |||
| 704 | dissect_dtls(tvb, pinfo, tree, data); | |||
| 705 | return true1; | |||
| 706 | } | |||
| 707 | if (offset == length) { | |||
| 708 | /* Can this ever happen? Well, just in case ... */ | |||
| 709 | dissect_dtls(tvb, pinfo, tree, data); | |||
| 710 | return true1; | |||
| 711 | } | |||
| 712 | } | |||
| 713 | ||||
| 714 | /* One last check to see if the current offset is at least less than the | |||
| 715 | * original number of bytes present before truncation or we're dealing with | |||
| 716 | * a packet fragment that's also been truncated. */ | |||
| 717 | if ((length >= 3) && (offset <= tvb_reported_length(tvb) || pinfo->fragmented)) { | |||
| 718 | dissect_dtls(tvb, pinfo, tree, data); | |||
| 719 | return true1; | |||
| 720 | } | |||
| 721 | return false0; | |||
| 722 | } | |||
| 723 | ||||
| 724 | static void | |||
| 725 | dtls_save_decrypted_record(packet_info *pinfo, int record_id, uint8_t content_type, SslDecoder *decoder, uint8_t curr_layer_num_ssl, bool_Bool inner_content_type) | |||
| 726 | { | |||
| 727 | const unsigned char *data = dtls_decrypted_data.data; | |||
| 728 | unsigned content_len = dtls_decrypted_data_avail; | |||
| 729 | ||||
| 730 | if (content_len == 0) { | |||
| 731 | return; | |||
| 732 | } | |||
| 733 | ||||
| 734 | if (content_type == SSL_ID_TLS12_CID || inner_content_type) { | |||
| 735 | /* | |||
| 736 | * The content is followed by the content type and then zero or | |||
| 737 | * more padding. Scan backwards for content type, skipping padding. | |||
| 738 | */ | |||
| 739 | while (content_len > 0 && data[content_len - 1] == 0) { | |||
| 740 | content_len--; | |||
| 741 | } | |||
| 742 | ssl_debug_printf("%s found %d padding bytes\n", G_STRFUNC((const char*) (__func__)), dtls_decrypted_data_avail - content_len); | |||
| 743 | if (content_len == 0) { | |||
| 744 | ssl_debug_printf("%s there is no room for content type!\n", G_STRFUNC((const char*) (__func__))); | |||
| 745 | return; | |||
| 746 | } | |||
| 747 | content_type = data[--content_len]; | |||
| 748 | if (content_len == 0) { | |||
| 749 | return; | |||
| 750 | } | |||
| 751 | } | |||
| 752 | ||||
| 753 | // For DTLS 1.3, the record sequence number was encrypted, so store it. | |||
| 754 | // tls_decrypt_aead_record does not increment decoder->seq after | |||
| 755 | // successful authentication for DTLS 1.3 (unlike for TLS.) | |||
| 756 | // XXX - The flow is only passed in here in order to support Follow Stream. | |||
| 757 | ssl_add_record_info(proto_dtls, pinfo, data, dtls_decrypted_data_avail, content_len, record_id, decoder->flow, (ContentType)content_type, curr_layer_num_ssl, decoder->seq); | |||
| 758 | } | |||
| 759 | ||||
| 760 | static bool_Bool | |||
| 761 | decrypt_dtls_record(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, SslDecryptSession *ssl, | |||
| 762 | uint8_t content_type, uint16_t record_version, uint16_t record_length, uint8_t curr_layer_num_ssl, | |||
| 763 | const unsigned char *cid, uint8_t cid_length) | |||
| 764 | { | |||
| 765 | bool_Bool success; | |||
| 766 | SslDecoder *decoder; | |||
| 767 | ||||
| 768 | /* if we can decrypt and decryption have success | |||
| 769 | * add decrypted data to this packet info */ | |||
| 770 | if (!ssl) { | |||
| 771 | ssl_debug_printf("decrypt_dtls_record: no session\n"); | |||
| 772 | return false0; | |||
| 773 | } | |||
| 774 | ssl_debug_printf("decrypt_dtls_record: app_data len %d, ssl state %X\n", | |||
| 775 | record_length, ssl->state); | |||
| 776 | ||||
| 777 | /* retrieve decoder for this packet direction */ | |||
| 778 | if (ssl_packet_from_server(&ssl->session, dtls_associations, pinfo) != 0) { | |||
| 779 | ssl_debug_printf("decrypt_dtls_record: using server decoder\n"); | |||
| 780 | decoder = ssl->server; | |||
| 781 | } | |||
| 782 | else { | |||
| 783 | ssl_debug_printf("decrypt_dtls_record: using client decoder\n"); | |||
| 784 | decoder = ssl->client; | |||
| 785 | } | |||
| 786 | ||||
| 787 | if (!decoder) { | |||
| 788 | ssl_debug_printf("decrypt_dtls_record: no decoder available\n"); | |||
| 789 | return false0; | |||
| 790 | } | |||
| 791 | ||||
| 792 | /* ensure we have enough storage space for decrypted data */ | |||
| 793 | if (record_length > dtls_decrypted_data.data_len) | |||
| 794 | { | |||
| 795 | ssl_debug_printf("decrypt_dtls_record: allocating %d bytes" | |||
| 796 | " for decrypt data (old len %d)\n", | |||
| 797 | record_length + 32, dtls_decrypted_data.data_len); | |||
| 798 | dtls_decrypted_data.data = (unsigned char *)g_realloc(dtls_decrypted_data.data, | |||
| 799 | record_length + 32); | |||
| 800 | dtls_decrypted_data.data_len = record_length + 32; | |||
| 801 | } | |||
| 802 | ||||
| 803 | /* run decryption and add decrypted payload to protocol data, if decryption | |||
| 804 | * is successful*/ | |||
| 805 | dtls_decrypted_data_avail = dtls_decrypted_data.data_len; | |||
| 806 | success = ssl_decrypt_record(pinfo->pool, ssl, decoder, content_type, record_version, false0, | |||
| 807 | tvb_get_ptr(tvb, offset, record_length), record_length, cid, cid_length, | |||
| 808 | &dtls_compressed_data, &dtls_decrypted_data, &dtls_decrypted_data_avail) == 0; | |||
| 809 | ||||
| 810 | if (success) { | |||
| 811 | dtls_save_decrypted_record(pinfo, tvb_raw_offset(tvb)+offset, content_type, decoder, curr_layer_num_ssl, ssl->session.version == DTLSV1DOT3_VERSION0xfefc); | |||
| 812 | } | |||
| 813 | return success; | |||
| 814 | } | |||
| 815 | ||||
| 816 | static void | |||
| 817 | export_pdu_packet(tvbuff_t *tvb, packet_info *pinfo, uint8_t tag, const char *name) | |||
| 818 | { | |||
| 819 | exp_pdu_data_t *exp_pdu_data = export_pdu_create_common_tags(pinfo, name, tag); | |||
| 820 | ||||
| 821 | exp_pdu_data->tvb_captured_length = tvb_captured_length(tvb); | |||
| 822 | exp_pdu_data->tvb_reported_length = tvb_reported_length(tvb); | |||
| 823 | exp_pdu_data->pdu_tvb = tvb; | |||
| 824 | ||||
| 825 | tap_queue_packet(exported_pdu_tap, pinfo, exp_pdu_data); | |||
| 826 | } | |||
| 827 | ||||
| 828 | ||||
| 829 | /********************************************************************* | |||
| 830 | * | |||
| 831 | * DTLS Dissection Routines | |||
| 832 | * | |||
| 833 | *********************************************************************/ | |||
| 834 | ||||
| 835 | static void | |||
| 836 | dissect_dtls_appdata(tvbuff_t *tvb, packet_info *pinfo, uint32_t offset, | |||
| 837 | uint32_t record_length, SslSession *session, | |||
| 838 | proto_tree *dtls_record_tree, bool_Bool is_from_server, | |||
| 839 | tvbuff_t *decrypted, SslRecordInfo *record) | |||
| 840 | { | |||
| 841 | heur_dtbl_entry_t *hdtbl_entry; | |||
| 842 | proto_item *ti; | |||
| 843 | /* show on info column what we are decoding */ | |||
| 844 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), "Application Data"); | |||
| 845 | ||||
| 846 | /* app_handle discovery is done here instead of dissect_dtls_payload() | |||
| 847 | * because the protocol name needs to be displayed below. */ | |||
| 848 | if (!session->app_handle) { | |||
| 849 | /* Unknown protocol handle, ssl_starttls_ack was not called before. | |||
| 850 | * Try to find an appropriate dissection handle and cache it. */ | |||
| 851 | dissector_handle_t handle; | |||
| 852 | handle = dissector_get_uint_handle(dtls_associations, PINFO_SRCPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port1 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->srcport)); | |||
| 853 | handle = handle ? handle : dissector_get_uint_handle(dtls_associations, PINFO_DESTPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port2 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->destport )); | |||
| 854 | if (handle) session->app_handle = handle; | |||
| 855 | } | |||
| 856 | ||||
| 857 | /* XXX - Add some kind of record replay detection preference? */ | |||
| 858 | proto_item_set_text(dtls_record_tree, | |||
| 859 | "%s Record Layer: %s Protocol: %s", | |||
| 860 | val_to_str_const(session->version, ssl_version_short_names, "DTLS"), | |||
| 861 | val_to_str_const(SSL_ID_APP_DATA, ssl_31_content_type, "unknown"), | |||
| 862 | session->app_handle | |||
| 863 | ? dissector_handle_get_protocol_long_name(session->app_handle) | |||
| 864 | : "Application Data"); | |||
| 865 | ||||
| 866 | proto_tree_add_item(dtls_record_tree, hf_dtls_record_appdata, tvb, | |||
| 867 | offset, record_length, ENC_NA0x00000000); | |||
| 868 | ||||
| 869 | if (session->app_handle) { | |||
| 870 | ti = proto_tree_add_string(dtls_record_tree, hf_dtls_record_appdata_proto, tvb, 0, 0, dissector_handle_get_protocol_long_name(session->app_handle)); | |||
| 871 | proto_item_set_generated(ti); | |||
| 872 | } | |||
| 873 | ||||
| 874 | /* show decrypted data info, if available */ | |||
| 875 | if (decrypted) { | |||
| 876 | bool_Bool dissected; | |||
| 877 | uint16_t saved_match_port; | |||
| 878 | const char *saved_match_string; | |||
| 879 | /* try to dissect decrypted data*/ | |||
| 880 | ssl_debug_printf("%s decrypted len %d\n", G_STRFUNC((const char*) (__func__)), record->content_len); | |||
| 881 | ||||
| 882 | saved_match_port = pinfo->match_uint; | |||
| 883 | if (is_from_server) { | |||
| 884 | pinfo->match_uint = PINFO_SRCPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port1 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->srcport); | |||
| 885 | } else { | |||
| 886 | pinfo->match_uint = PINFO_DESTPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port2 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->destport ); | |||
| 887 | } | |||
| 888 | saved_match_string = pinfo->match_string; | |||
| 889 | pinfo->match_string = session->alpn_name; | |||
| 890 | ||||
| 891 | /* find out a dissector using ALPN or server port*/ | |||
| 892 | if (session->app_handle) { | |||
| 893 | ssl_debug_printf("%s: found handle %p (%s)\n", G_STRFUNC((const char*) (__func__)), | |||
| 894 | (void *)session->app_handle, | |||
| 895 | dissector_handle_get_dissector_name(session->app_handle)); | |||
| 896 | ssl_print_data("decrypted app data", record->plain_data, record->content_len); | |||
| 897 | ||||
| 898 | if (have_tap_listener(exported_pdu_tap)) { | |||
| 899 | export_pdu_packet(decrypted, pinfo, EXP_PDU_TAG_DISSECTOR_NAME12, | |||
| 900 | dissector_handle_get_dissector_name(session->app_handle)); | |||
| 901 | } | |||
| 902 | ||||
| 903 | dissected = (bool_Bool)call_dissector_only(session->app_handle, decrypted, pinfo, top_tree, NULL((void*)0)); | |||
| 904 | } | |||
| 905 | else { | |||
| 906 | /* try heuristic subdissectors */ | |||
| 907 | dissected = dissector_try_heuristic(heur_subdissector_list, decrypted, pinfo, top_tree, &hdtbl_entry, NULL((void*)0)); | |||
| 908 | if (dissected && have_tap_listener(exported_pdu_tap)) { | |||
| 909 | export_pdu_packet(decrypted, pinfo, EXP_PDU_TAG_HEUR_DISSECTOR_NAME13, hdtbl_entry->short_name); | |||
| 910 | } | |||
| 911 | } | |||
| 912 | pinfo->match_uint = saved_match_port; | |||
| 913 | pinfo->match_string = saved_match_string; | |||
| 914 | /* fallback to data dissector */ | |||
| 915 | if (!dissected) { | |||
| 916 | call_data_dissector(decrypted, pinfo, top_tree); | |||
| 917 | if (have_tap_listener(exported_pdu_tap)) { | |||
| 918 | export_pdu_packet(decrypted, pinfo, EXP_PDU_TAG_DISSECTOR_NAME12, "data"); | |||
| 919 | } | |||
| 920 | } | |||
| 921 | } | |||
| 922 | } | |||
| 923 | /* Dissect a DTLS record from version 1.2 and below */ | |||
| 924 | static int | |||
| 925 | dissect_dtls_record(tvbuff_t *tvb, packet_info *pinfo, | |||
| 926 | proto_tree *tree, uint32_t offset, | |||
| 927 | SslSession *session, int is_from_server, | |||
| 928 | SslDecryptSession* ssl, | |||
| 929 | uint8_t curr_layer_num_ssl) | |||
| 930 | { | |||
| 931 | ||||
| 932 | /* | |||
| 933 | * struct { | |||
| 934 | * uint8 major, minor; | |||
| 935 | * } ProtocolVersion; | |||
| 936 | * | |||
| 937 | * | |||
| 938 | * enum { | |||
| 939 | * change_cipher_spec(20), alert(21), handshake(22), | |||
| 940 | * application_data(23), (255) | |||
| 941 | * } ContentType; | |||
| 942 | * | |||
| 943 | * struct { | |||
| 944 | * ContentType type; | |||
| 945 | * ProtocolVersion version; | |||
| 946 | * uint16 epoch; // New field | |||
| 947 | * uint48 sequence_number; // New field | |||
| 948 | * uint16 length; | |||
| 949 | * opaque fragment[TLSPlaintext.length]; | |||
| 950 | * } DTLSPlaintext; | |||
| 951 | * | |||
| 952 | * | |||
| 953 | * draft-ietf-tls-dtls-connection-id-07: | |||
| 954 | * | |||
| 955 | * struct { | |||
| 956 | * ContentType special_type = tls12_cid; | |||
| 957 | * ProtocolVersion version; | |||
| 958 | * uint16 epoch; | |||
| 959 | * uint48 sequence_number; | |||
| 960 | * opaque cid[cid_length]; // New field | |||
| 961 | * uint16 length; | |||
| 962 | * opaque enc_content[DTLSCiphertext.length]; | |||
| 963 | * } DTLSCiphertext; | |||
| 964 | * | |||
| 965 | */ | |||
| 966 | ||||
| 967 | uint32_t dtls_record_length; | |||
| 968 | uint32_t record_length; | |||
| 969 | uint16_t version; | |||
| 970 | uint16_t epoch; | |||
| 971 | uint64_t sequence_number; | |||
| 972 | uint8_t content_type; | |||
| 973 | uint8_t next_byte; | |||
| 974 | proto_tree *ti; | |||
| 975 | proto_tree *dtls_record_tree; | |||
| 976 | proto_item *length_pi, *ct_pi; | |||
| 977 | tvbuff_t *decrypted; | |||
| 978 | SslRecordInfo *record = NULL((void*)0); | |||
| 979 | uint8_t *cid = NULL((void*)0); | |||
| 980 | uint8_t cid_length; | |||
| 981 | ||||
| 982 | /* Connection ID length to use if any */ | |||
| 983 | cid_length = dtls_cid_length(session, is_from_server); | |||
| 984 | ||||
| 985 | /* | |||
| 986 | * Get the record layer fields of interest | |||
| 987 | */ | |||
| 988 | content_type = tvb_get_uint8(tvb, offset); | |||
| 989 | if ((content_type & DTLS13_FIXED_MASK0xE0) >> 5 == 1) { | |||
| 990 | /* RFC 9147 s4.1: this is a DTLS 1.3 Unified Header record */ | |||
| 991 | return dissect_dtls13_record(tvb, pinfo, tree, offset, session, | |||
| 992 | is_from_server, ssl, curr_layer_num_ssl); | |||
| 993 | } | |||
| 994 | version = tvb_get_ntohs(tvb, offset + 1); | |||
| 995 | epoch = tvb_get_ntohs(tvb, offset + 3); | |||
| 996 | sequence_number = tvb_get_ntoh48(tvb, offset + 5); | |||
| 997 | ||||
| 998 | if (content_type == SSL_ID_TLS12_CID && cid_length > 0) { | |||
| 999 | cid = tvb_memdup(pinfo->pool, tvb, offset + 11, cid_length); | |||
| 1000 | record_length = tvb_get_ntohs(tvb, offset + cid_length + 11); | |||
| 1001 | dtls_record_length = 13 + cid_length + record_length; | |||
| 1002 | } else { | |||
| 1003 | record_length = tvb_get_ntohs(tvb, offset + 11); | |||
| 1004 | dtls_record_length = 13 + record_length; | |||
| 1005 | } | |||
| 1006 | ||||
| 1007 | if (!ssl_is_valid_content_type(content_type)) { | |||
| 1008 | ||||
| 1009 | /* if we don't have a valid content_type, there's no sense | |||
| 1010 | * continuing any further | |||
| 1011 | */ | |||
| 1012 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), "Continuation Data"); | |||
| 1013 | ||||
| 1014 | /* If GUI, show unrecognized data in tree */ | |||
| 1015 | ti = proto_tree_add_item(tree, hf_dtls_record, tvb, | |||
| 1016 | offset, dtls_record_length, ENC_NA0x00000000); | |||
| 1017 | dtls_record_tree = proto_item_add_subtree(ti, ett_dtls_record); | |||
| 1018 | proto_item_set_text(dtls_record_tree, "%s Record Layer: unrecognized content type 0x%02x", | |||
| 1019 | val_to_str_const(session->version, ssl_version_short_names, "DTLS"), | |||
| 1020 | content_type); | |||
| 1021 | ||||
| 1022 | return offset + dtls_record_length; | |||
| 1023 | } | |||
| 1024 | ||||
| 1025 | if (ssl) { | |||
| 1026 | if (is_from_server) { | |||
| 1027 | if (ssl->server) { | |||
| 1028 | ssl->server->seq = sequence_number; | |||
| 1029 | ssl->server->epoch = epoch; | |||
| 1030 | } | |||
| 1031 | } else { | |||
| 1032 | if (ssl->client) { | |||
| 1033 | ssl->client->seq = sequence_number; | |||
| 1034 | ssl->client->epoch = epoch; | |||
| 1035 | } | |||
| 1036 | } | |||
| 1037 | } | |||
| 1038 | ||||
| 1039 | /* | |||
| 1040 | * If GUI, fill in record layer part of tree | |||
| 1041 | */ | |||
| 1042 | ||||
| 1043 | /* add the record layer subtree header */ | |||
| 1044 | ti = proto_tree_add_item(tree, hf_dtls_record, tvb, | |||
| 1045 | offset, dtls_record_length, ENC_NA0x00000000); | |||
| 1046 | dtls_record_tree = proto_item_add_subtree(ti, ett_dtls_record); | |||
| 1047 | ||||
| 1048 | /* show the one-byte content type */ | |||
| 1049 | if (content_type == SSL_ID_TLS12_CID) { | |||
| 1050 | ct_pi = proto_tree_add_item(dtls_record_tree, hf_dtls_record_special_type, | |||
| 1051 | tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); | |||
| 1052 | } else { | |||
| 1053 | ct_pi = proto_tree_add_item(dtls_record_tree, hf_dtls_record_content_type, | |||
| 1054 | tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); | |||
| 1055 | } | |||
| 1056 | offset++; | |||
| 1057 | ||||
| 1058 | /* add the version */ | |||
| 1059 | proto_tree_add_item(dtls_record_tree, hf_dtls_record_version, tvb, | |||
| 1060 | offset, 2, ENC_BIG_ENDIAN0x00000000); | |||
| 1061 | offset += 2; | |||
| 1062 | ||||
| 1063 | /* show epoch */ | |||
| 1064 | proto_tree_add_uint(dtls_record_tree, hf_dtls_record_epoch, tvb, offset, 2, epoch); | |||
| 1065 | offset += 2; | |||
| 1066 | ||||
| 1067 | /* add sequence_number */ | |||
| 1068 | proto_tree_add_uint64(dtls_record_tree, hf_dtls_record_sequence_number, tvb, offset, 6, sequence_number); | |||
| 1069 | offset += 6; | |||
| 1070 | ||||
| 1071 | if (content_type == SSL_ID_TLS12_CID) { | |||
| 1072 | /* add connection ID */ | |||
| 1073 | proto_tree_add_item(dtls_record_tree, hf_dtls_record_connection_id, tvb, offset, cid_length, ENC_NA0x00000000); | |||
| 1074 | offset += cid_length; | |||
| 1075 | } | |||
| 1076 | ||||
| 1077 | /* add the length */ | |||
| 1078 | length_pi = proto_tree_add_uint(dtls_record_tree, hf_dtls_record_length, tvb, | |||
| 1079 | offset, 2, record_length); | |||
| 1080 | offset += 2; /* move past length field itself */ | |||
| 1081 | ||||
| 1082 | /* | |||
| 1083 | * if we don't already have a version set for this conversation, | |||
| 1084 | * but this message's version is authoritative (i.e., it's | |||
| 1085 | * not client_hello), then save the version to the conversation | |||
| 1086 | * structure and print the column version. | |||
| 1087 | */ | |||
| 1088 | next_byte = tvb_get_uint8(tvb, offset); | |||
| 1089 | if (session->version == SSL_VER_UNKNOWN0) { | |||
| 1090 | if (version == DTLSV1DOT2_VERSION0xfefd && content_type == SSL_ID_HANDSHAKE) { | |||
| 1091 | /* | |||
| 1092 | * if the version in the header is DTLS 1.2, this may actually be | |||
| 1093 | * a DTLS 1.3 handshake; this must be determined from any | |||
| 1094 | * supported_versions extension in the hello messages. We'll check | |||
| 1095 | * this later in dissect_dtls_handshake, but try to get the column | |||
| 1096 | * correct here on the first pass if we can. | |||
| 1097 | */ | |||
| 1098 | if (next_byte == SSL_HND_SERVER_HELLO && record_length > 12 && tvb_bytes_exist(tvb, offset, 12)) { | |||
| 1099 | uint32_t fragment_offset = tvb_get_ntoh24(tvb, offset + 6); | |||
| 1100 | uint32_t fragment_length = tvb_get_ntoh24(tvb, offset + 9); | |||
| 1101 | if (fragment_offset == 0 && tvb_bytes_exist(tvb, offset + 12, fragment_length)) { | |||
| 1102 | /* Only look at the first fragment. */ | |||
| 1103 | tls_scan_server_hello(tvb, offset + 12, offset + 12 + fragment_length, &version, NULL((void*)0)); | |||
| 1104 | } | |||
| 1105 | } | |||
| 1106 | } | |||
| 1107 | ssl_try_set_version(session, ssl, content_type, next_byte, true1, version); | |||
| 1108 | } | |||
| 1109 | col_set_str(pinfo->cinfo, COL_PROTOCOL, | |||
| 1110 | val_to_str_const(session->version, ssl_version_short_names, "DTLS")); | |||
| 1111 | ||||
| 1112 | /* | |||
| 1113 | * now dissect the next layer | |||
| 1114 | */ | |||
| 1115 | ssl_debug_printf("dissect_dtls_record: content_type %d epoch %d seq %"PRIu64"l" "u""\n", content_type, epoch, sequence_number); | |||
| 1116 | ||||
| 1117 | /* try to decrypt record on the first pass, if possible. Store decrypted | |||
| 1118 | * record for later usage (without having to decrypt again). | |||
| 1119 | * DTLSv1.3 records are decrypted from dissect_dtls13_record */ | |||
| 1120 | if (ssl && (ssl->session.version != DTLSV1DOT3_VERSION0xfefc)) { | |||
| 1121 | decrypt_dtls_record(tvb, pinfo, offset, ssl, content_type, version, record_length, curr_layer_num_ssl, cid, cid_length); | |||
| 1122 | } | |||
| 1123 | decrypted = ssl_get_record_info(tvb, proto_dtls, pinfo, tvb_raw_offset(tvb)+offset, curr_layer_num_ssl, &record); | |||
| 1124 | if (decrypted) { | |||
| 1125 | add_new_data_source(pinfo, decrypted, "Decrypted DTLS"); | |||
| 1126 | ||||
| 1127 | if (content_type == SSL_ID_TLS12_CID) { | |||
| 1128 | content_type = record->type; | |||
| 1129 | proto_tree_add_uint(dtls_record_tree, hf_dtls_record_content_type, | |||
| 1130 | decrypted, record->content_len, 1, record->type); | |||
| 1131 | decrypted = tvb_new_subset_length(decrypted, 0, record->content_len); | |||
| 1132 | } | |||
| 1133 | } | |||
| 1134 | ssl_check_record_length(&dissect_dtls_hf, pinfo, (ContentType)content_type, record_length, length_pi, session->version, decrypted); | |||
| 1135 | ||||
| 1136 | /* extract the real record from the connection ID record */ | |||
| 1137 | if (content_type == SSL_ID_TLS12_CID) { | |||
| 1138 | proto_item_set_text(dtls_record_tree, "%s Record Layer: Connection ID", | |||
| 1139 | val_to_str_const(session->version, ssl_version_short_names, "DTLS")); | |||
| 1140 | ||||
| 1141 | /* if content cannot be deciphered or the content is invalid */ | |||
| 1142 | if (decrypted == NULL((void*)0)) { | |||
| 1143 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), "Connection ID"); | |||
| 1144 | proto_tree_add_item(dtls_record_tree, hf_dtls_record_encrypted_content, tvb, | |||
| 1145 | offset, record_length, ENC_NA0x00000000); | |||
| 1146 | offset += record_length; /* skip to end of record */ | |||
| 1147 | return offset; | |||
| 1148 | } | |||
| 1149 | } | |||
| 1150 | ||||
| 1151 | switch ((ContentType) content_type) { | |||
| 1152 | case SSL_ID_CHG_CIPHER_SPEC: | |||
| 1153 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), "Change Cipher Spec"); | |||
| 1154 | ssl_dissect_change_cipher_spec(&dissect_dtls_hf, tvb, pinfo, | |||
| 1155 | dtls_record_tree, offset, session, | |||
| 1156 | is_from_server, ssl); | |||
| 1157 | if (ssl) { | |||
| 1158 | ssl_finalize_decryption(ssl, tls_get_master_key_map(true1)); | |||
| 1159 | ssl_change_cipher(ssl, is_from_server); | |||
| 1160 | } | |||
| 1161 | /* Heuristic: any later ChangeCipherSpec is not a resumption of this | |||
| 1162 | * session. Set the flag after ssl_finalize_decryption such that it has | |||
| 1163 | * a chance to use resume using Session Tickets. */ | |||
| 1164 | if (is_from_server) | |||
| 1165 | session->is_session_resumed = false0; | |||
| 1166 | break; | |||
| 1167 | case SSL_ID_ALERT: | |||
| 1168 | { | |||
| 1169 | /* try to retrieve and use decrypted alert record, if any. */ | |||
| 1170 | if (decrypted) { | |||
| 1171 | dissect_dtls_alert(decrypted, pinfo, dtls_record_tree, 0, | |||
| 1172 | session); | |||
| 1173 | } else { | |||
| 1174 | dissect_dtls_alert(tvb, pinfo, dtls_record_tree, offset, | |||
| 1175 | session); | |||
| 1176 | } | |||
| 1177 | break; | |||
| 1178 | } | |||
| 1179 | case SSL_ID_HANDSHAKE: | |||
| 1180 | { | |||
| 1181 | /* try to retrieve and use decrypted handshake record, if any. */ | |||
| 1182 | if (decrypted) { | |||
| 1183 | dissect_dtls_handshake(decrypted, pinfo, dtls_record_tree, 0, | |||
| 1184 | tvb_reported_length(decrypted), false0, session, is_from_server, | |||
| 1185 | ssl, content_type, epoch); | |||
| 1186 | } else { | |||
| 1187 | dissect_dtls_handshake(tvb, pinfo, dtls_record_tree, offset, | |||
| 1188 | record_length, true1, session, is_from_server, ssl, | |||
| 1189 | content_type, epoch); | |||
| 1190 | } | |||
| 1191 | break; | |||
| 1192 | } | |||
| 1193 | case SSL_ID_APP_DATA: | |||
| 1194 | dissect_dtls_appdata(tvb, pinfo, offset, record_length, session, | |||
| 1195 | dtls_record_tree, is_from_server, decrypted, record); | |||
| 1196 | break; | |||
| 1197 | case SSL_ID_HEARTBEAT: | |||
| 1198 | /* try to retrieve and use decrypted alert record, if any. */ | |||
| 1199 | if (decrypted) { | |||
| 1200 | dissect_dtls_heartbeat(decrypted, pinfo, dtls_record_tree, 0, | |||
| 1201 | session, tvb_reported_length (decrypted), true1); | |||
| 1202 | } else { | |||
| 1203 | dissect_dtls_heartbeat(tvb, pinfo, dtls_record_tree, offset, | |||
| 1204 | session, record_length, false0); | |||
| 1205 | } | |||
| 1206 | break; | |||
| 1207 | case SSL_ID_TLS12_CID: | |||
| 1208 | expert_add_info_format(pinfo, ct_pi, &ei_dtls_cid_invalid_content_type, | |||
| 1209 | "Invalid content type (%d)", content_type); | |||
| 1210 | break; | |||
| 1211 | case SSL_ID_DTLS13_ACK: | |||
| 1212 | if (decrypted) { | |||
| 1213 | dissect_dtls_ack(decrypted, pinfo, dtls_record_tree, 0, tvb_reported_length(decrypted)); | |||
| 1214 | } else { | |||
| 1215 | dissect_dtls_ack(tvb, pinfo, dtls_record_tree, offset, record_length); | |||
| 1216 | } | |||
| 1217 | } | |||
| 1218 | offset += record_length; /* skip to end of record */ | |||
| 1219 | ||||
| 1220 | return offset; | |||
| 1221 | } | |||
| 1222 | ||||
| 1223 | ||||
| 1224 | /* setup cryptographic keys based on dtls13_current_epoch */ | |||
| 1225 | static int | |||
| 1226 | dtls13_load_keys_from_epoch(SslDecryptSession *session, bool_Bool is_from_server, uint64_t epoch) | |||
| 1227 | { | |||
| 1228 | ssl_master_key_map_t *master_key_map = NULL((void*)0); | |||
| 1229 | TLSRecordType secret_type; | |||
| 1230 | SslDecoder *dec; | |||
| 1231 | ||||
| 1232 | if (!session) { | |||
| 1233 | ssl_debug_printf("dtls13_load_keys_from_epoch: no session\n"); | |||
| 1234 | return -1; | |||
| 1235 | } | |||
| 1236 | ||||
| 1237 | dec = NULL((void*)0); | |||
| 1238 | if (is_from_server) | |||
| 1239 | dec = session->server; | |||
| 1240 | else | |||
| 1241 | dec = session->client; | |||
| 1242 | ||||
| 1243 | if (dec && dec->dtls13_epoch == epoch) | |||
| 1244 | return 0; | |||
| 1245 | ||||
| 1246 | /* The DTLS dissector does not support decrypting packets from epoch < N once | |||
| 1247 | * it decrypted a packet from epoch N. In order to do that, the dissector | |||
| 1248 | * needs to maintain the expected next sequence number per epoch. The added | |||
| 1249 | * complexity makes it not worthwhile. */ | |||
| 1250 | if (dec && dec->dtls13_epoch > epoch) { | |||
| 1251 | ssl_debug_printf("%s: refuse to load past epoch %" PRIu64"l" "u""\n", G_STRFUNC((const char*) (__func__)), epoch); | |||
| 1252 | return 0; | |||
| 1253 | } | |||
| 1254 | ||||
| 1255 | /* double check that we increment the epoch by one after hs */ | |||
| 1256 | if (dec && dec->dtls13_epoch != 0 && epoch != dec->dtls13_epoch + 1) | |||
| 1257 | return 0; | |||
| 1258 | ||||
| 1259 | master_key_map = tls_get_master_key_map(true1); | |||
| 1260 | if (master_key_map == NULL((void*)0)) { | |||
| 1261 | ssl_debug_printf("dtls13_load_keys_from_epoch: no master key map\n"); | |||
| 1262 | return -1; | |||
| 1263 | } | |||
| 1264 | ||||
| 1265 | switch (epoch) | |||
| 1266 | { | |||
| 1267 | case 1: | |||
| 1268 | secret_type = TLS_SECRET_0RTT_APP; | |||
| 1269 | tls13_change_key(session, master_key_map, is_from_server, secret_type); | |||
| 1270 | break; | |||
| 1271 | case 2: | |||
| 1272 | secret_type = TLS_SECRET_HANDSHAKE; | |||
| 1273 | tls13_change_key(session, master_key_map, is_from_server, secret_type); | |||
| 1274 | break; | |||
| 1275 | case 3: | |||
| 1276 | secret_type = TLS_SECRET_APP; | |||
| 1277 | tls13_change_key(session, master_key_map, is_from_server, secret_type); | |||
| 1278 | break; | |||
| 1279 | default: | |||
| 1280 | tls13_key_update(session, is_from_server); | |||
| 1281 | break; | |||
| 1282 | } | |||
| 1283 | ||||
| 1284 | if (is_from_server && session->server) { | |||
| 1285 | session->server->dtls13_epoch = epoch; | |||
| 1286 | } else if (session->client) { | |||
| 1287 | session->client->dtls13_epoch = epoch; | |||
| 1288 | } | |||
| 1289 | ||||
| 1290 | return 0; | |||
| 1291 | } | |||
| 1292 | ||||
| 1293 | ||||
| 1294 | /** | |||
| 1295 | * Reconstructs sequence numbers in DTLS 1.3. | |||
| 1296 | * | |||
| 1297 | * This function takes the expected sequence number, the low bits of the sequence number, | |||
| 1298 | * and a mask as input. It finds the closest number to the expected sequence number that | |||
| 1299 | * has the lower bits equal to @seq_low_bits. | |||
| 1300 | * @param expected_seq_number The expected sequence number. | |||
| 1301 | * @param seq_low_bits The low bits of the sequence number (encrypted). | |||
| 1302 | * @param len The length of @enc_seq_low_bits. | |||
| 1303 | * @param dec_mask The decryption mask for @enc_seq_low_bits. | |||
| 1304 | * @return The reconstructed dequeued sequence number. | |||
| 1305 | */ | |||
| 1306 | static uint64_t dtls13_reconstruct_seq_number(uint64_t expected_seq_number, uint16_t seq_low_bits, | |||
| 1307 | int len, uint8_t *dec_mask) | |||
| 1308 | { | |||
| 1309 | uint16_t expected_low_bits; | |||
| 1310 | uint64_t c1, c2, d1, d2; | |||
| 1311 | uint16_t mask; | |||
| 1312 | ||||
| 1313 | /* The leading 1 or 2 bytes of the xor mask cover the sequence number | |||
| 1314 | * bytes on the wire (RFC 9147 section 4.2.3). */ | |||
| 1315 | if (len == 1) { | |||
| 1316 | seq_low_bits ^= dec_mask[0]; | |||
| 1317 | } else { | |||
| 1318 | seq_low_bits ^= (dec_mask[0] << 8 | dec_mask[1]); | |||
| 1319 | } | |||
| 1320 | ||||
| 1321 | mask = (len == 2) ? 0xffff : 0xff; | |||
| 1322 | expected_low_bits = expected_seq_number & mask; | |||
| 1323 | c1 = (expected_seq_number & ~(mask)) | seq_low_bits; | |||
| 1324 | ||||
| 1325 | if (expected_low_bits == seq_low_bits) { | |||
| 1326 | return c1; | |||
| 1327 | } | |||
| 1328 | if (expected_low_bits < seq_low_bits) { | |||
| 1329 | /* There is no smaller candidate below sequence number 0. */ | |||
| 1330 | if (c1 < (uint64_t)mask + 1) | |||
| 1331 | return c1; | |||
| 1332 | d1 = c1 - expected_seq_number; | |||
| 1333 | c2 = c1 - (mask + 1); | |||
| 1334 | d2 = expected_seq_number - c2; | |||
| 1335 | } else { | |||
| 1336 | d1 = expected_seq_number - c1; | |||
| 1337 | c2 = c1 + (mask + 1); | |||
| 1338 | d2 = c2 - expected_seq_number; | |||
| 1339 | } | |||
| 1340 | ||||
| 1341 | if (d1 < d2) | |||
| 1342 | return c1; | |||
| 1343 | return c2; | |||
| 1344 | } | |||
| 1345 | ||||
| 1346 | #define DTLS13_RECORD_NUMBER_MASK_SZ16 16 | |||
| 1347 | static int dtls13_get_record_number_xor_mask(SslDecoder *dec, const uint8_t *ciphertext, uint8_t *mask) | |||
| 1348 | { | |||
| 1349 | if (!dec->cipher_suite) | |||
| 1350 | return -1; | |||
| 1351 | ||||
| 1352 | if (dec->cipher_suite->enc == ENC_NULL0x3D) { | |||
| 1353 | memset(mask, 0, DTLS13_RECORD_NUMBER_MASK_SZ16); | |||
| 1354 | return 0; | |||
| 1355 | } | |||
| 1356 | ||||
| 1357 | if (!dec->sn_evp) { | |||
| 1358 | return -1; | |||
| 1359 | } | |||
| 1360 | ||||
| 1361 | if (dec->cipher_suite->enc == ENC_AES0x35 || dec->cipher_suite->enc == ENC_AES2560x36) { | |||
| 1362 | if (gcry_cipher_encrypt(dec->sn_evp, mask, DTLS13_RECORD_NUMBER_MASK_SZ16, | |||
| 1363 | ciphertext, DTLS13_RECORD_NUMBER_MASK_SZ16) != 0) { | |||
| 1364 | ssl_debug_printf("dtls1.3: record mask generation failed\n"); | |||
| 1365 | return -1; | |||
| 1366 | } | |||
| 1367 | return 0; | |||
| 1368 | } | |||
| 1369 | ||||
| 1370 | if (dec->cipher_suite->enc == ENC_CHACHA200x3A) { | |||
| 1371 | if (gcry_cipher_setiv(dec->sn_evp, ciphertext, DTLS13_RECORD_NUMBER_MASK_SZ16) != 0) { | |||
| 1372 | ssl_debug_printf("dtls1.3: record mask generation failed: can't set iv\n"); | |||
| 1373 | return -1; | |||
| 1374 | } | |||
| 1375 | memset(mask, 0, DTLS13_RECORD_NUMBER_MASK_SZ16); | |||
| 1376 | if (gcry_cipher_encrypt(dec->sn_evp, mask, DTLS13_RECORD_NUMBER_MASK_SZ16, mask, DTLS13_RECORD_NUMBER_MASK_SZ16) != 0) { | |||
| 1377 | ssl_debug_printf("dtls1.3: record mask generation failed\n"); | |||
| 1378 | return -1; | |||
| 1379 | } | |||
| 1380 | return 0; | |||
| 1381 | } | |||
| 1382 | ||||
| 1383 | ssl_debug_printf("dtls1.3: unsupported cipher\n"); | |||
| 1384 | return -1; | |||
| 1385 | } | |||
| 1386 | ||||
| 1387 | static bool_Bool dtls13_create_aad(tvbuff_t *tvb, SslDecryptSession *ssl, bool_Bool is_from_server, uint8_t hdr_flags, uint32_t hdr_off, uint32_t hdr_size, | |||
| 1388 | uint64_t sequence_number, uint16_t dtls_record_length) | |||
| 1389 | { | |||
| 1390 | unsigned int cid_length = 0; | |||
| 1391 | SslDecoder *dec = NULL((void*)0); | |||
| 1392 | int seq_length; | |||
| 1393 | ||||
| 1394 | if (is_from_server && ssl->server) { | |||
| 1395 | dec = ssl->server; | |||
| 1396 | } else if (ssl->client) { | |||
| 1397 | dec = ssl->client; | |||
| 1398 | } | |||
| 1399 | if (!dec) | |||
| 1400 | return false0; | |||
| 1401 | ||||
| 1402 | dec->seq = sequence_number; | |||
| 1403 | dec->dtls13_aad.data = wmem_realloc(wmem_file_scope(), dec->dtls13_aad.data, hdr_size); | |||
| 1404 | dec->dtls13_aad.data_len = hdr_size; | |||
| 1405 | dec->dtls13_aad.data[0] = hdr_flags; | |||
| 1406 | cid_length = 0; | |||
| 1407 | ||||
| 1408 | seq_length = 1; | |||
| 1409 | if (hdr_flags & DTLS13_S_BIT_MASK0x08) | |||
| 1410 | seq_length = 2; | |||
| 1411 | if (hdr_flags & DTLS13_C_BIT_MASK0x10) { | |||
| 1412 | /* total - 1 byte for hdr flag, 1 or 2 byte for seq suffix, 0 or 2 bytes for len */ | |||
| 1413 | cid_length = hdr_size - 1 - seq_length; | |||
| 1414 | if (hdr_flags & DTLS13_L_BIT_MASK0x04) | |||
| 1415 | cid_length -= 2; | |||
| 1416 | DISSECTOR_ASSERT(cid_length < hdr_size)((void) ((cid_length < hdr_size) ? (void)0 : (proto_report_dissector_bug ("%s:%u: failed assertion \"%s\"", "epan/dissectors/packet-dtls.c" , 1416, "cid_length < hdr_size")))); | |||
| 1417 | memcpy(&dec->dtls13_aad.data[1], tvb_get_ptr(tvb, hdr_off + 1, cid_length), cid_length); | |||
| 1418 | } | |||
| 1419 | ||||
| 1420 | if (seq_length == 2) { | |||
| 1421 | phtonu16(&dec->dtls13_aad.data[1 + cid_length], (uint16_t)sequence_number); | |||
| 1422 | } else { | |||
| 1423 | dec->dtls13_aad.data[1 + cid_length] = (uint8_t)sequence_number; | |||
| 1424 | } | |||
| 1425 | if (hdr_flags & DTLS13_L_BIT_MASK0x04) { | |||
| 1426 | phtonu16(&dec->dtls13_aad.data[1 + cid_length + seq_length], dtls_record_length); | |||
| 1427 | } | |||
| 1428 | ||||
| 1429 | return true1; | |||
| 1430 | } | |||
| 1431 | ||||
| 1432 | static bool_Bool dtls13_decrypt_unified_record(tvbuff_t *tvb, packet_info *pinfo, uint32_t hdr_off, uint32_t hdr_size, | |||
| 1433 | uint8_t hdr_flags, bool_Bool is_from_server, | |||
| 1434 | SslDecryptSession *ssl, uint32_t dtls_record_length, uint8_t curr_layer_num_ssl, | |||
| 1435 | uint16_t seq_suffix, uint8_t seq_length) | |||
| 1436 | { | |||
| 1437 | uint8_t mask[DTLS13_RECORD_NUMBER_MASK_SZ16]; | |||
| 1438 | uint64_t sequence_number; | |||
| 1439 | SslDecoder *dec = NULL((void*)0); | |||
| 1440 | bool_Bool success; | |||
| 1441 | ||||
| 1442 | if (is_from_server && ssl->server) { | |||
| 1443 | dec = ssl->server; | |||
| 1444 | } else if (ssl->client) { | |||
| 1445 | dec = ssl->client; | |||
| 1446 | } | |||
| 1447 | ||||
| 1448 | if (dec == NULL((void*)0)) { | |||
| 1449 | ssl_debug_printf("dissect_dtls13_record: no decoder available\n"); | |||
| 1450 | return false0; | |||
| 1451 | } | |||
| 1452 | ||||
| 1453 | if (dtls13_get_record_number_xor_mask(dec, tvb_get_ptr(tvb, hdr_off + hdr_size, DTLS13_RECORD_NUMBER_MASK_SZ16), mask) != 0) { | |||
| 1454 | ssl_debug_printf("dissect_dtls13_record: can't get record number mask\n"); | |||
| 1455 | return false0; | |||
| 1456 | } | |||
| 1457 | ||||
| 1458 | sequence_number = dtls13_reconstruct_seq_number(ssl->session.dtls13_next_seq_num[is_from_server], seq_suffix, seq_length, mask); | |||
| 1459 | ||||
| 1460 | /* setup parameter for decryption of this packet */ | |||
| 1461 | if (!dtls13_create_aad(tvb, ssl, is_from_server, hdr_flags, hdr_off, hdr_size, sequence_number, dtls_record_length)) { | |||
| 1462 | ssl_debug_printf("%s: can't create AAD\n", G_STRFUNC((const char*) (__func__))); | |||
| 1463 | return false0; | |||
| 1464 | } | |||
| 1465 | ||||
| 1466 | /* CID is already included in dtls13_add, there is no need to add it here */ | |||
| 1467 | success = decrypt_dtls_record(tvb, pinfo, hdr_off + hdr_size, ssl, 0, ssl->session.version, dtls_record_length, curr_layer_num_ssl, NULL((void*)0), 0); | |||
| 1468 | /* Only a record that decrypts moves the expected sequence number: the | |||
| 1469 | * number of a record that does not (a wrong key in the early data trial | |||
| 1470 | * decryption, a corrupt record) is garbage. */ | |||
| 1471 | if (success && sequence_number >= ssl->session.dtls13_next_seq_num[is_from_server]) { | |||
| 1472 | ssl->session.dtls13_next_seq_num[is_from_server] = sequence_number + 1; | |||
| 1473 | } | |||
| 1474 | ||||
| 1475 | return success; | |||
| 1476 | } | |||
| 1477 | ||||
| 1478 | /** | |||
| 1479 | * Try to guess the early data cipher using trial decryption. based on decrypt_tls13_early_data. | |||
| 1480 | * Requires Libgcrypt 1.6 or newer for verifying that decryption is successful. | |||
| 1481 | */ | |||
| 1482 | static bool_Bool | |||
| 1483 | dtls13_decrypt_early_data(tvbuff_t *tvb, packet_info *pinfo, uint32_t hdr_off, uint32_t hdr_size, uint8_t hdr_flags, | |||
| 1484 | uint16_t record_length, SslDecryptSession *ssl, | |||
| 1485 | uint8_t curr_layer_num_ssl, uint16_t seq_suffix, uint8_t seq_length) | |||
| 1486 | { | |||
| 1487 | StringInfo *secret; | |||
| 1488 | ||||
| 1489 | static const uint16_t tls13_ciphers[] = { | |||
| 1490 | 0x1301, /* TLS_AES_128_GCM_SHA256 */ | |||
| 1491 | 0x1302, /* TLS_AES_256_GCM_SHA384 */ | |||
| 1492 | 0x1303, /* TLS_CHACHA20_POLY1305_SHA256 */ | |||
| 1493 | 0x1304, /* TLS_AES_128_CCM_SHA256 */ | |||
| 1494 | 0x1305, /* TLS_AES_128_CCM_8_SHA256 */ | |||
| 1495 | }; | |||
| 1496 | ||||
| 1497 | bool_Bool success = false0; | |||
| 1498 | ||||
| 1499 | ssl_debug_printf("Trying early data encryption, first record / trial decryption: %s\n", | |||
| 1500 | !(ssl->state & SSL_SEEN_0RTT_APPDATA(1<<12)) ? "true" : "false"); | |||
| 1501 | ||||
| 1502 | // Early data is used with a PSK. (The early secret is computed w/o | |||
| 1503 | // input from the (EC)DHE even if psk_dhe_ke is used.) | |||
| 1504 | tls_load_psk(ssl, dtls_options.psk); | |||
| 1505 | secret = tls13_load_secret(ssl, tls_get_master_key_map(true1), false0, TLS_SECRET_0RTT_APP); | |||
| 1506 | if (!secret) { | |||
| 1507 | ssl_debug_printf("Missing secrets, early data decryption not possible!\n"); | |||
| 1508 | return false0; | |||
| 1509 | } | |||
| 1510 | ||||
| 1511 | for (unsigned i = 0; i < G_N_ELEMENTS(tls13_ciphers)(sizeof (tls13_ciphers) / sizeof ((tls13_ciphers)[0])); i++) { | |||
| 1512 | uint16_t cipher = tls13_ciphers[i]; | |||
| 1513 | ||||
| 1514 | ssl_debug_printf("Performing early data trial decryption, cipher = %#x\n", cipher); | |||
| 1515 | ssl->session.cipher = cipher; | |||
| 1516 | ssl->cipher_suite = ssl_find_cipher(cipher); | |||
| 1517 | if (!tls13_generate_keys(ssl, secret, false0)) { | |||
| 1518 | /* Unable to create cipher (old Libgcrypt) */ | |||
| 1519 | continue; | |||
| 1520 | } | |||
| 1521 | ||||
| 1522 | success = dtls13_decrypt_unified_record(tvb, pinfo, hdr_off, hdr_size, hdr_flags, false0, ssl, record_length, curr_layer_num_ssl, seq_suffix, seq_length); | |||
| 1523 | if (success) { | |||
| 1524 | /* update epoch number to decrypt other 0RTT packets */ | |||
| 1525 | ssl->client->dtls13_epoch = 1; | |||
| 1526 | ssl_debug_printf("Early data decryption succeeded, cipher = %#x\n", cipher); | |||
| 1527 | break; | |||
| 1528 | } | |||
| 1529 | } | |||
| 1530 | if (!success) { | |||
| 1531 | ssl_debug_printf("Trial decryption of early data failed!\n"); | |||
| 1532 | } | |||
| 1533 | return success; | |||
| 1534 | } | |||
| 1535 | ||||
| 1536 | static bool_Bool dtls13_setup_keys(uint8_t hdr_flags, bool_Bool is_from_server, SslDecryptSession *ssl, uint32_t dtls_record_length, | |||
| 1537 | bool_Bool *first_early_data) | |||
| 1538 | { | |||
| 1539 | uint64_t epoch, curr_max_epoch; | |||
| 1540 | ||||
| 1541 | epoch = (hdr_flags & DTLS13_HDR_EPOCH_BIT_MASK0x3); | |||
| 1542 | ||||
| 1543 | if (first_early_data != NULL((void*)0)) | |||
| 1544 | *first_early_data = false0; | |||
| 1545 | ||||
| 1546 | /* DTLSv1.3 minimum payload is 16 bytes */ | |||
| 1547 | if (dtls_record_length < 16) { | |||
| 1548 | ssl_debug_printf("dtls13: record too short\n"); | |||
| 1549 | return false0; | |||
| 1550 | } | |||
| 1551 | ||||
| 1552 | /* determine the epoch */ | |||
| 1553 | curr_max_epoch = ssl->session.dtls13_current_epoch[is_from_server]; | |||
| 1554 | ||||
| 1555 | if ((curr_max_epoch & 0x3) != epoch) { | |||
| 1556 | /* No KeyUpdate seen, we are still in the handshake (epoch 1 or 2) or using traffic_secret_0 (epoch 3) */ | |||
| 1557 | if (curr_max_epoch < 4) { | |||
| 1558 | if (epoch > curr_max_epoch) { | |||
| 1559 | ssl->session.dtls13_current_epoch[is_from_server] = epoch; | |||
| 1560 | } | |||
| 1561 | } else { | |||
| 1562 | ||||
| 1563 | /* try to decrypt with the last epoch with the same low bits */ | |||
| 1564 | epoch = (curr_max_epoch & ~(0x3)) | epoch; | |||
| 1565 | if (epoch > curr_max_epoch) | |||
| 1566 | epoch -= 4; | |||
| 1567 | } | |||
| 1568 | } else { | |||
| 1569 | epoch = curr_max_epoch; | |||
| 1570 | } | |||
| 1571 | ||||
| 1572 | if (epoch == 0) { | |||
| 1573 | ssl_debug_printf("dtls13: unified header with epoch 0 (plaintext)\n"); | |||
| 1574 | return false0; | |||
| 1575 | } | |||
| 1576 | ||||
| 1577 | /* early data */ | |||
| 1578 | if (epoch == 1) { | |||
| 1579 | if (ssl->session.dtls13_current_epoch[is_from_server] > 1) { | |||
| 1580 | ssl_debug_printf("%s: early data received after encrypted HS, abort decryption\n", G_STRFUNC((const char*) (__func__))); | |||
| 1581 | return false0; | |||
| 1582 | } | |||
| 1583 | if (!ssl->has_early_data) { | |||
| 1584 | ssl_debug_printf("%s: early data received but not advertised in CH extensions, abort decryption\n", G_STRFUNC((const char*) (__func__))); | |||
| 1585 | return false0; | |||
| 1586 | } | |||
| 1587 | /* first early data packet, need to go into trial decryption */ | |||
| 1588 | if (!(ssl->client && (ssl->client->dtls13_epoch == 1))) { | |||
| 1589 | if (first_early_data != NULL((void*)0)) | |||
| 1590 | *first_early_data = true1; | |||
| 1591 | return true1; | |||
| 1592 | } | |||
| 1593 | } | |||
| 1594 | ||||
| 1595 | if (dtls13_load_keys_from_epoch(ssl, is_from_server, epoch) < 0) { | |||
| 1596 | ssl_debug_printf("dtls13: can't load keys\n"); | |||
| 1597 | return false0; | |||
| 1598 | } | |||
| 1599 | ||||
| 1600 | return true1; | |||
| 1601 | } | |||
| 1602 | ||||
| 1603 | /* Dissect a DTLS record from version 1.3 */ | |||
| 1604 | static int | |||
| 1605 | dissect_dtls13_record(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), | |||
| 1606 | proto_tree *tree, uint32_t offset, | |||
| 1607 | SslSession *session, int is_from_server, | |||
| 1608 | SslDecryptSession* ssl, | |||
| 1609 | uint8_t curr_layer_num_ssl _U___attribute__((unused))) | |||
| 1610 | { | |||
| 1611 | /* | |||
| 1612 | * struct { | |||
| 1613 | * ContentType type; | |||
| 1614 | * ProtocolVersion legacy_record_version; | |||
| 1615 | * uint16 epoch = 0 | |||
| 1616 | * uint48 sequence_number; | |||
| 1617 | * uint16 length; | |||
| 1618 | * opaque fragment[DTLSPlaintext.length]; | |||
| 1619 | * } DTLSPlaintext; | |||
| 1620 | * | |||
| 1621 | * struct { | |||
| 1622 | * opaque content[DTLSPlaintext.length]; | |||
| 1623 | * ContentType type; | |||
| 1624 | * uint8 zeros[length_of_padding]; | |||
| 1625 | * } DTLSInnerPlaintext; | |||
| 1626 | * | |||
| 1627 | * struct { | |||
| 1628 | * opaque unified_hdr[variable]; | |||
| 1629 | * opaque encrypted_record[length]; | |||
| 1630 | * } DTLSCiphertext; | |||
| 1631 | * | |||
| 1632 | * unified_hdr: | |||
| 1633 | * 0 1 2 3 4 5 6 7 | |||
| 1634 | * +-+-+-+-+-+-+-+-+ | |||
| 1635 | * |0|0|1|C|S|L|E E| | |||
| 1636 | * +-+-+-+-+-+-+-+-+ | |||
| 1637 | * | Connection ID | Legend: | |||
| 1638 | * | (if any, | | |||
| 1639 | * / length as / C - Connection ID (CID) present | |||
| 1640 | * | negotiated) | S - Sequence number length | |||
| 1641 | * +-+-+-+-+-+-+-+-+ L - Length present | |||
| 1642 | * | 8 or 16 bit | E - Epoch | |||
| 1643 | * |Sequence Number| | |||
| 1644 | * +-+-+-+-+-+-+-+-+ | |||
| 1645 | * | 16 bit Length | | |||
| 1646 | * | (if present) | | |||
| 1647 | * +-+-+-+-+-+-+-+-+ | |||
| 1648 | */ | |||
| 1649 | ||||
| 1650 | static int * const uni_hdr_flags[] = { | |||
| 1651 | &hf_dtls_uni_hdr_fixed, | |||
| 1652 | &hf_dtls_uni_hdr_cid, | |||
| 1653 | &hf_dtls_uni_hdr_seq, | |||
| 1654 | &hf_dtls_uni_hdr_len, | |||
| 1655 | &hf_dtls_uni_hdr_epoch, | |||
| 1656 | NULL((void*)0) | |||
| 1657 | }; | |||
| 1658 | ||||
| 1659 | proto_tree *dtls_record_tree; | |||
| 1660 | proto_item *ti; | |||
| 1661 | proto_item *length_pi; | |||
| 1662 | uint32_t dtls_record_length = 0; | |||
| 1663 | ||||
| 1664 | uint32_t hdr_offset = offset; | |||
| 1665 | uint32_t hdr_start = offset; | |||
| 1666 | uint8_t hdr_flags; | |||
| 1667 | bool_Bool c_bit; /* 1 = Connection ID field is present */ | |||
| 1668 | bool_Bool s_bit; /* 0 = 8-bit sequence number, 1 = 16-bit */ | |||
| 1669 | bool_Bool l_bit; /* 1 = Length field is present */ | |||
| 1670 | ||||
| 1671 | uint8_t seq_length; | |||
| 1672 | uint8_t cid_length = 0; | |||
| 1673 | uint16_t seq_suffix; | |||
| 1674 | tvbuff_t *decrypted = NULL((void*)0); | |||
| 1675 | SslRecordInfo *record = NULL((void*)0); | |||
| 1676 | bool_Bool success; | |||
| 1677 | bool_Bool is_first_early_data; | |||
| 1678 | ||||
| 1679 | hdr_flags = tvb_get_uint8(tvb, hdr_offset); | |||
| 1680 | c_bit = (hdr_flags & DTLS13_C_BIT_MASK0x10) == DTLS13_C_BIT_MASK0x10; | |||
| 1681 | s_bit = (hdr_flags & DTLS13_S_BIT_MASK0x08) == DTLS13_S_BIT_MASK0x08; | |||
| 1682 | l_bit = (hdr_flags & DTLS13_L_BIT_MASK0x04) == DTLS13_L_BIT_MASK0x04; | |||
| 1683 | hdr_offset += 1; | |||
| 1684 | ||||
| 1685 | if (c_bit) { | |||
| 1686 | /* Connection ID length to use if any */ | |||
| 1687 | cid_length = dtls_cid_length(session, is_from_server); | |||
| 1688 | hdr_offset += cid_length; | |||
| 1689 | } | |||
| 1690 | ||||
| 1691 | if (s_bit) { | |||
| 1692 | /* Lowest 16 bits of the sequence number */ | |||
| 1693 | seq_length = 2; | |||
| 1694 | seq_suffix = tvb_get_ntohs(tvb, hdr_offset); | |||
| 1695 | } | |||
| 1696 | else { | |||
| 1697 | /* Lowest 8 bits of the sequence number */ | |||
| 1698 | seq_length = 1; | |||
| 1699 | seq_suffix = tvb_get_uint8(tvb, hdr_offset); | |||
| 1700 | } | |||
| 1701 | /* Note: seq_suffix is encrypted if the payload is encrypted, | |||
| 1702 | * as per RFC 9147 section 4.2.3. To get the real sequence number, | |||
| 1703 | * we need to decrypt, and *then* use the result to find the sequence | |||
| 1704 | * number closest to one plus the last sequence number. | |||
| 1705 | */ | |||
| 1706 | hdr_offset += seq_length; | |||
| 1707 | ||||
| 1708 | if (l_bit) { | |||
| 1709 | dtls_record_length = tvb_get_ntohs(tvb, hdr_offset); | |||
| 1710 | hdr_offset += 2; | |||
| 1711 | } | |||
| 1712 | else { | |||
| 1713 | dtls_record_length = tvb_captured_length_remaining(tvb, hdr_offset); | |||
| 1714 | } | |||
| 1715 | ||||
| 1716 | /* | |||
| 1717 | * If GUI, fill in record layer part of tree | |||
| 1718 | */ | |||
| 1719 | col_set_str(pinfo->cinfo, COL_PROTOCOL, | |||
| 1720 | val_to_str_const(session->version, ssl_version_short_names, "DTLS")); | |||
| 1721 | ||||
| 1722 | ti = proto_tree_add_item(tree, hf_dtls_record, tvb, offset, | |||
| 1723 | (hdr_offset - offset) + dtls_record_length, ENC_NA0x00000000); | |||
| 1724 | dtls_record_tree = proto_item_add_subtree(ti, ett_dtls_record); | |||
| 1725 | ||||
| 1726 | proto_tree_add_bitmask_with_flags(dtls_record_tree, tvb, offset, | |||
| 1727 | hf_dtls_uni_hdr, ett_dtls_uni_hdr, uni_hdr_flags, | |||
| 1728 | ENC_BIG_ENDIAN0x00000000, BMT_NO_INT0x02); | |||
| 1729 | ||||
| 1730 | offset += 1; | |||
| 1731 | ||||
| 1732 | if (c_bit && cid_length > 0) { | |||
| 1733 | proto_tree_add_item(dtls_record_tree, hf_dtls_record_connection_id, tvb, offset, cid_length, ENC_NA0x00000000); | |||
| 1734 | offset += cid_length; | |||
| 1735 | } | |||
| 1736 | ||||
| 1737 | proto_tree_add_uint(dtls_record_tree, hf_dtls_record_sequence_suffix, tvb, offset, seq_length, seq_suffix); | |||
| 1738 | offset += seq_length; | |||
| 1739 | ||||
| 1740 | if (l_bit) { | |||
| 1741 | proto_tree_add_item(dtls_record_tree, hf_dtls_record_length, tvb, | |||
| 1742 | offset, 2, ENC_BIG_ENDIAN0x00000000); | |||
| 1743 | offset += 2; | |||
| 1744 | } | |||
| 1745 | else { | |||
| 1746 | length_pi = proto_tree_add_uint(dtls_record_tree, hf_dtls_record_length, tvb, | |||
| 1747 | offset, 0, dtls_record_length); | |||
| 1748 | proto_item_set_generated(length_pi); | |||
| 1749 | } | |||
| 1750 | ||||
| 1751 | if (ssl) { | |||
| 1752 | success = dtls13_setup_keys(hdr_flags, is_from_server, ssl, dtls_record_length, &is_first_early_data); | |||
| 1753 | if (success) { | |||
| 1754 | if (!is_from_server && is_first_early_data) { | |||
| 1755 | /* try to decrypt early data */ | |||
| 1756 | dtls13_decrypt_early_data(tvb, pinfo, hdr_start, hdr_offset - hdr_start, hdr_flags, dtls_record_length, ssl, curr_layer_num_ssl, seq_suffix, seq_length); | |||
| 1757 | } else { | |||
| 1758 | dtls13_decrypt_unified_record(tvb, pinfo, hdr_start, hdr_offset - hdr_start, hdr_flags, is_from_server, ssl, dtls_record_length, curr_layer_num_ssl, seq_suffix, seq_length); | |||
| 1759 | } | |||
| 1760 | } | |||
| 1761 | } | |||
| 1762 | ||||
| 1763 | decrypted = ssl_get_record_info(tvb, proto_dtls, pinfo, tvb_raw_offset(tvb)+offset, curr_layer_num_ssl, &record); | |||
| 1764 | if (decrypted) | |||
| 1765 | { | |||
| 1766 | add_new_data_source(pinfo, decrypted, "Decrypted DTLS"); | |||
| 1767 | ||||
| 1768 | proto_tree_add_uint(dtls_record_tree, hf_dtls_record_content_type, | |||
| 1769 | decrypted, record->content_len, 1, record->type); | |||
| 1770 | decrypted = tvb_new_subset_length(decrypted, 0, record->content_len); | |||
| 1771 | ||||
| 1772 | ti = proto_tree_add_uint(dtls_record_tree, hf_dtls_record_sequence_suffix_dec, tvb, hdr_start + 1 + cid_length, | |||
| 1773 | seq_length, (uint16_t)record->record_seq); | |||
| 1774 | proto_item_set_generated(ti); | |||
| 1775 | /* real content type*/ | |||
| 1776 | switch ((record->type)) | |||
| 1777 | { | |||
| 1778 | case SSL_ID_HANDSHAKE: | |||
| 1779 | dissect_dtls_handshake(decrypted, pinfo, dtls_record_tree, 0, | |||
| 1780 | tvb_reported_length(decrypted), false0, session, is_from_server, | |||
| 1781 | ssl, record->type, 0); | |||
| 1782 | break; | |||
| 1783 | case SSL_ID_ALERT: | |||
| 1784 | dissect_dtls_alert(decrypted, pinfo, dtls_record_tree, 0, | |||
| 1785 | session); | |||
| 1786 | break; | |||
| 1787 | case SSL_ID_DTLS13_ACK: | |||
| 1788 | dissect_dtls_ack(decrypted, pinfo, dtls_record_tree, 0, tvb_reported_length(decrypted)); | |||
| 1789 | break; | |||
| 1790 | case SSL_ID_APP_DATA: | |||
| 1791 | dissect_dtls_appdata(tvb, pinfo, offset, dtls_record_length, session, | |||
| 1792 | dtls_record_tree, is_from_server, decrypted, record); | |||
| 1793 | break; | |||
| 1794 | default: | |||
| 1795 | break; | |||
| 1796 | } | |||
| 1797 | } else { | |||
| 1798 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), "Encrypted Data"); | |||
| 1799 | proto_tree_add_item(dtls_record_tree, hf_dtls_record_encrypted_content, tvb, | |||
| 1800 | offset, dtls_record_length, ENC_NA0x00000000); | |||
| 1801 | proto_item_set_text(dtls_record_tree, | |||
| 1802 | "%s Record Layer: Encrypted Data", | |||
| 1803 | val_to_str_const(session->version, ssl_version_short_names, "DTLS")); | |||
| 1804 | } | |||
| 1805 | ||||
| 1806 | return offset + dtls_record_length; | |||
| 1807 | } | |||
| 1808 | ||||
| 1809 | /* dissects the alert message, filling in the tree */ | |||
| 1810 | static void | |||
| 1811 | dissect_dtls_alert(tvbuff_t *tvb, packet_info *pinfo, | |||
| 1812 | proto_tree *tree, uint32_t offset, | |||
| 1813 | const SslSession *session) | |||
| 1814 | { | |||
| 1815 | /* struct { | |||
| 1816 | * AlertLevel level; | |||
| 1817 | * AlertDescription description; | |||
| 1818 | * } Alert; | |||
| 1819 | */ | |||
| 1820 | ||||
| 1821 | proto_tree *ti; | |||
| 1822 | proto_tree *ssl_alert_tree; | |||
| 1823 | const char *level; | |||
| 1824 | const char *desc; | |||
| 1825 | uint8_t byte; | |||
| 1826 | ||||
| 1827 | ti = proto_tree_add_item(tree, hf_dtls_alert_message, tvb, | |||
| 1828 | offset, 2, ENC_NA0x00000000); | |||
| 1829 | ssl_alert_tree = proto_item_add_subtree(ti, ett_dtls_alert); | |||
| 1830 | ||||
| 1831 | /* | |||
| 1832 | * set the record layer label | |||
| 1833 | */ | |||
| 1834 | ||||
| 1835 | /* first lookup the names for the alert level and description */ | |||
| 1836 | byte = tvb_get_uint8(tvb, offset); /* grab the level byte */ | |||
| 1837 | level = try_val_to_str(byte, ssl_31_alert_level); | |||
| 1838 | ||||
| 1839 | byte = tvb_get_uint8(tvb, offset+1); /* grab the desc byte */ | |||
| 1840 | desc = try_val_to_str(byte, ssl_31_alert_description); | |||
| 1841 | ||||
| 1842 | /* now set the text in the record layer line */ | |||
| 1843 | if (level && desc) | |||
| 1844 | { | |||
| 1845 | col_append_sep_fstr(pinfo->cinfo, COL_INFO, | |||
| 1846 | NULL((void*)0), "Alert (Level: %s, Description: %s)", | |||
| 1847 | level, desc); | |||
| 1848 | } | |||
| 1849 | else | |||
| 1850 | { | |||
| 1851 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), "Encrypted Alert"); | |||
| 1852 | } | |||
| 1853 | ||||
| 1854 | if (tree) | |||
| 1855 | { | |||
| 1856 | if (level && desc) | |||
| 1857 | { | |||
| 1858 | proto_item_set_text(tree, "%s Record Layer: Alert " | |||
| 1859 | "(Level: %s, Description: %s)", | |||
| 1860 | val_to_str_const(session->version, ssl_version_short_names, "DTLS"), | |||
| 1861 | level, desc); | |||
| 1862 | proto_tree_add_item(ssl_alert_tree, hf_dtls_alert_message_level, | |||
| 1863 | tvb, offset++, 1, ENC_BIG_ENDIAN0x00000000); | |||
| 1864 | ||||
| 1865 | proto_tree_add_item(ssl_alert_tree, hf_dtls_alert_message_description, | |||
| 1866 | tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); | |||
| 1867 | } | |||
| 1868 | else | |||
| 1869 | { | |||
| 1870 | proto_item_set_text(tree, | |||
| 1871 | "%s Record Layer: Encrypted Alert", | |||
| 1872 | val_to_str_const(session->version, ssl_version_short_names, "DTLS")); | |||
| 1873 | proto_item_set_text(ssl_alert_tree, | |||
| 1874 | "Alert Message: Encrypted Alert"); | |||
| 1875 | } | |||
| 1876 | } | |||
| 1877 | } | |||
| 1878 | ||||
| 1879 | static void | |||
| 1880 | dtls13_maybe_increase_max_epoch(SslDecryptSession *ssl, bool_Bool is_from_server) | |||
| 1881 | { | |||
| 1882 | SslDecoder *dec; | |||
| 1883 | ||||
| 1884 | if (ssl == NULL((void*)0)) | |||
| 1885 | return; | |||
| 1886 | ||||
| 1887 | if (is_from_server) | |||
| 1888 | dec = ssl->server; | |||
| 1889 | else | |||
| 1890 | dec = ssl->client; | |||
| 1891 | ||||
| 1892 | if (dec == NULL((void*)0)) | |||
| 1893 | return; | |||
| 1894 | ||||
| 1895 | /* be sure to increment from the current epoch just once, and to increment | |||
| 1896 | * again only after the new epoch was seen. This assures that the dissector | |||
| 1897 | * can always compute the next epoch, and avoid that duplicate packets wrongly | |||
| 1898 | * increment the max epoch multiple times. */ | |||
| 1899 | if (dec->dtls13_epoch == ssl->session.dtls13_current_epoch[is_from_server]) | |||
| 1900 | ssl->session.dtls13_current_epoch[is_from_server]++; | |||
| 1901 | } | |||
| 1902 | ||||
| 1903 | /* | |||
| 1904 | * The most fragments of one handshake message that are reassembled. A | |||
| 1905 | * real handshake message needs well under 100 fragments, but a crafted | |||
| 1906 | * capture can pack thousands of tiny fragments into one datagram, and | |||
| 1907 | * the cost of adding a fragment grows with the number already held. | |||
| 1908 | * Further fragments are not added and the message stays unreassembled. | |||
| 1909 | */ | |||
| 1910 | #define DTLS_MAX_MSG_FRAGMENTS1000 1000 | |||
| 1911 | ||||
| 1912 | /* | |||
| 1913 | * Decide on the first pass whether this fragment is beyond the limit, and | |||
| 1914 | * remember a refusal per fragment so that later passes (when the list | |||
| 1915 | * holds the fragments of all frames) decide the same. | |||
| 1916 | */ | |||
| 1917 | static bool_Bool | |||
| 1918 | dtls_fragment_limit_reached(packet_info *pinfo, uint32_t offset, uint32_t frag_seq) | |||
| 1919 | { | |||
| 1920 | static const char limit_marker = 1; | |||
| 1921 | uint32_t key = offset + ((uint32_t)pinfo->curr_layer_num << 24); | |||
| 1922 | fragment_head *fd_head; | |||
| 1923 | unsigned count = 0; | |||
| 1924 | ||||
| 1925 | if (PINFO_FD_VISITED(pinfo)((pinfo)->fd->visited)) | |||
| 1926 | return p_get_proto_data(wmem_file_scope(), pinfo, proto_dtls, key) != NULL((void*)0); | |||
| 1927 | ||||
| 1928 | fd_head = fragment_get(&dtls_reassembly_table, pinfo, frag_seq, NULL((void*)0)); | |||
| 1929 | if (fd_head != NULL((void*)0)) { | |||
| 1930 | fragment_item *fd; | |||
| 1931 | for (fd = fd_head->next; fd != NULL((void*)0) && count < DTLS_MAX_MSG_FRAGMENTS1000; fd = fd->next) | |||
| 1932 | count++; | |||
| 1933 | } | |||
| 1934 | if (count >= DTLS_MAX_MSG_FRAGMENTS1000) { | |||
| 1935 | p_add_proto_data(wmem_file_scope(), pinfo, proto_dtls, key, (void *)&limit_marker); | |||
| 1936 | return true1; | |||
| 1937 | } | |||
| 1938 | return false0; | |||
| 1939 | } | |||
| 1940 | ||||
| 1941 | /* dissects the handshake protocol, filling the tree */ | |||
| 1942 | static void | |||
| 1943 | dissect_dtls_handshake(tvbuff_t *tvb, packet_info *pinfo, | |||
| 1944 | proto_tree *tree, uint32_t offset, | |||
| 1945 | uint32_t record_length, bool_Bool maybe_encrypted, | |||
| 1946 | SslSession *session, int is_from_server, | |||
| 1947 | SslDecryptSession* ssl, uint8_t content_type, | |||
| 1948 | uint16_t epoch) | |||
| 1949 | { | |||
| 1950 | /* struct { | |||
| 1951 | * HandshakeType msg_type; | |||
| 1952 | * uint24 length; | |||
| 1953 | * uint16 message_seq; //new field | |||
| 1954 | * uint24 fragment_offset; //new field | |||
| 1955 | * uint24 fragment_length; //new field | |||
| 1956 | * select (HandshakeType) { | |||
| 1957 | * case hello_request: HelloRequest; | |||
| 1958 | * case client_hello: ClientHello; | |||
| 1959 | * case server_hello: ServerHello; | |||
| 1960 | * case hello_verify_request: HelloVerifyRequest; //new field | |||
| 1961 | * case certificate: Certificate; | |||
| 1962 | * case server_key_exchange: ServerKeyExchange; | |||
| 1963 | * case certificate_request: CertificateRequest; | |||
| 1964 | * case server_hello_done: ServerHelloDone; | |||
| 1965 | * case certificate_verify: CertificateVerify; | |||
| 1966 | * case client_key_exchange: ClientKeyExchange; | |||
| 1967 | * case finished: Finished; | |||
| 1968 | * } body; | |||
| 1969 | * } Handshake; | |||
| 1970 | */ | |||
| 1971 | ||||
| 1972 | proto_tree *ti, *length_item = NULL((void*)0), *fragment_length_item = NULL((void*)0); | |||
| 1973 | proto_tree *ssl_hand_tree; | |||
| 1974 | const char *msg_type_str; | |||
| 1975 | uint8_t msg_type; | |||
| 1976 | uint32_t length; | |||
| 1977 | uint16_t version; | |||
| 1978 | uint32_t message_seq; | |||
| 1979 | uint32_t fragment_offset; | |||
| 1980 | uint32_t fragment_length; | |||
| 1981 | bool_Bool first_iteration; | |||
| 1982 | uint32_t reassembled_length; | |||
| 1983 | tvbuff_t *sub_tvb; | |||
| 1984 | ||||
| 1985 | msg_type_str = NULL((void*)0); | |||
| 1986 | first_iteration = true1; | |||
| 1987 | ||||
| 1988 | /* just as there can be multiple records per packet, there | |||
| 1989 | * can be multiple messages per record as long as they have | |||
| 1990 | * the same content type | |||
| 1991 | * | |||
| 1992 | * we really only care about this for handshake messages | |||
| 1993 | */ | |||
| 1994 | ||||
| 1995 | /* set record_length to the max offset */ | |||
| 1996 | record_length += offset; | |||
| 1997 | for (; offset < record_length; offset += fragment_length, | |||
| 1998 | first_iteration = false0) /* set up for next pass, if any */ | |||
| 1999 | { | |||
| 2000 | fragment_head *frag_msg = NULL((void*)0); | |||
| 2001 | tvbuff_t *new_tvb = NULL((void*)0); | |||
| 2002 | const char *frag_str = NULL((void*)0); | |||
| 2003 | bool_Bool fragmented; | |||
| 2004 | uint32_t hs_offset = offset; | |||
| 2005 | bool_Bool is_hrr = 0; | |||
| 2006 | ||||
| 2007 | /* add a subtree for the handshake protocol */ | |||
| 2008 | ti = proto_tree_add_item(tree, hf_dtls_handshake_protocol, tvb, offset, -1, ENC_NA0x00000000); | |||
| 2009 | ssl_hand_tree = proto_item_add_subtree(ti, ett_dtls_handshake); | |||
| 2010 | ||||
| 2011 | msg_type = tvb_get_uint8(tvb, offset); | |||
| 2012 | fragment_length = tvb_get_ntoh24(tvb, offset + 9); | |||
| 2013 | ||||
| 2014 | /* Check the fragment length in the handshake message. Assume it's an | |||
| 2015 | * encrypted handshake message if the message would pass | |||
| 2016 | * the record_length boundary. This is a workaround for the | |||
| 2017 | * situation where the first octet of the encrypted handshake | |||
| 2018 | * message is actually a known handshake message type. | |||
| 2019 | */ | |||
| 2020 | if (!maybe_encrypted || offset + 12 + fragment_length <= record_length) { | |||
| 2021 | if (msg_type == SSL_HND_SERVER_HELLO) { | |||
| 2022 | tls_scan_server_hello(tvb, offset + 12, offset + 12 + fragment_length, &version, &is_hrr); | |||
| 2023 | } | |||
| 2024 | if (is_hrr) { | |||
| 2025 | msg_type_str = try_val_to_str(SSL_HND_HELLO_RETRY_REQUEST, ssl_31_handshake_type); | |||
| 2026 | } else { | |||
| 2027 | msg_type_str = try_val_to_str(msg_type, ssl_31_handshake_type); | |||
| 2028 | } | |||
| 2029 | } | |||
| 2030 | ||||
| 2031 | if (!msg_type_str && !first_iteration) | |||
| 2032 | { | |||
| 2033 | /* only dissect / report messages if they're | |||
| 2034 | * either the first message in this record | |||
| 2035 | * or they're a valid message type | |||
| 2036 | */ | |||
| 2037 | return; | |||
| 2038 | } | |||
| 2039 | ||||
| 2040 | /* | |||
| 2041 | * Update our info string | |||
| 2042 | */ | |||
| 2043 | if (msg_type_str) | |||
| 2044 | { | |||
| 2045 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), msg_type_str); | |||
| 2046 | } | |||
| 2047 | else | |||
| 2048 | { | |||
| 2049 | /* if we don't have a valid handshake type, just quit dissecting */ | |||
| 2050 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), "Encrypted Handshake Message"); | |||
| 2051 | return; | |||
| 2052 | } | |||
| 2053 | ||||
| 2054 | proto_tree_add_uint(ssl_hand_tree, hf_dtls_handshake_type, | |||
| 2055 | tvb, offset, 1, msg_type); | |||
| 2056 | offset++; | |||
| 2057 | ||||
| 2058 | length_item = proto_tree_add_item_ret_uint(ssl_hand_tree, hf_dtls_handshake_length, | |||
| 2059 | tvb, offset, 3, ENC_BIG_ENDIAN0x00000000, &length); | |||
| 2060 | offset += 3; | |||
| 2061 | ||||
| 2062 | proto_tree_add_item_ret_uint(ssl_hand_tree, hf_dtls_handshake_message_seq, | |||
| 2063 | tvb, offset, 2, ENC_BIG_ENDIAN0x00000000, &message_seq); | |||
| 2064 | offset += 2; | |||
| 2065 | ||||
| 2066 | proto_tree_add_item_ret_uint(ssl_hand_tree, hf_dtls_handshake_fragment_offset, | |||
| 2067 | tvb, offset, 3, ENC_BIG_ENDIAN0x00000000, &fragment_offset); | |||
| 2068 | offset += 3; | |||
| 2069 | ||||
| 2070 | fragment_length_item = proto_tree_add_uint(ssl_hand_tree, | |||
| 2071 | hf_dtls_handshake_fragment_length, | |||
| 2072 | tvb, offset, 3, | |||
| 2073 | fragment_length); | |||
| 2074 | offset += 3; | |||
| 2075 | proto_item_set_len(ti, fragment_length + 12); | |||
| 2076 | ||||
| 2077 | fragmented = false0; | |||
| 2078 | ||||
| 2079 | /* In DTLS 1.2, the message_seq is reset and the epoch incremented | |||
| 2080 | * at each rehandshake (i.e., renegotiation), so concatenate them | |||
| 2081 | * for a fragment sequence number. However, in DTLS 1.3 the | |||
| 2082 | * message_seq is not reset in a post-handshake message exchange | |||
| 2083 | * (so having passed in 0 as the epoch here instead of the real | |||
| 2084 | * 64-bit DTLS 1.3 epoch should work unless message_seq has | |||
| 2085 | * wrapped around, which is unlikely as it is only incremented | |||
| 2086 | * in handshake messages). | |||
| 2087 | * https://www.rfc-editor.org/rfc/rfc9147.html#section-5.2-6 | |||
| 2088 | * https://datatracker.ietf.org/doc/html/rfc6347#section-4.1 | |||
| 2089 | */ | |||
| 2090 | uint32_t frag_seq = ((uint32_t)epoch << 16) | message_seq; | |||
| 2091 | if (ssl) { // first pass | |||
| 2092 | uint32_t *next_receive_p; | |||
| 2093 | if (is_from_server) { | |||
| 2094 | next_receive_p = &ssl->server_next_receive_seq; | |||
| 2095 | } else { | |||
| 2096 | next_receive_p = &ssl->client_next_receive_seq; | |||
| 2097 | } | |||
| 2098 | if (frag_seq < *next_receive_p) { | |||
| 2099 | ssl = NULL((void*)0); // Retransmission; don't update decoder state | |||
| 2100 | } else if (frag_seq == *next_receive_p || (message_seq == 0)) { | |||
| 2101 | // message_seq == 0 and frag_seq > *next_receive_p can only | |||
| 2102 | // occur if the epoch has increased and the message seq is 0, | |||
| 2103 | // which is DTLS 1.2 only, and it is safe to increment | |||
| 2104 | // next_receive_p in such a case (assume at renegotiation we | |||
| 2105 | // no longer care about handshake messages from the previous | |||
| 2106 | // handshake.) | |||
| 2107 | *next_receive_p = frag_seq + 1; | |||
| 2108 | } | |||
| 2109 | } | |||
| 2110 | ||||
| 2111 | if (fragment_length + fragment_offset > length) | |||
| 2112 | { | |||
| 2113 | if (fragment_offset == 0) | |||
| 2114 | { | |||
| 2115 | expert_add_info(pinfo, fragment_length_item, &ei_dtls_handshake_fragment_length_too_long); | |||
| 2116 | } | |||
| 2117 | else | |||
| 2118 | { | |||
| 2119 | fragmented = true1; | |||
| 2120 | expert_add_info(pinfo, fragment_length_item, &ei_dtls_handshake_fragment_past_end_msg); | |||
| 2121 | } | |||
| 2122 | } | |||
| 2123 | else if (fragment_offset > 0 && fragment_length == 0) | |||
| 2124 | { | |||
| 2125 | /* Fragmented message, but no actual fragment... Note that if a | |||
| 2126 | * fragment was previously completed (reassembled_length == length), | |||
| 2127 | * it is already dissected. */ | |||
| 2128 | expert_add_info(pinfo, fragment_length_item, &ei_dtls_handshake_fragment_length_zero); | |||
| 2129 | continue; | |||
| 2130 | } | |||
| 2131 | else if (fragment_length < length) | |||
| 2132 | { | |||
| 2133 | fragmented = true1; | |||
| 2134 | ||||
| 2135 | /* Handle fragments of known message type, ignore others */ | |||
| 2136 | if (ssl_is_valid_handshake_type(msg_type, true1)) | |||
| 2137 | { | |||
| 2138 | /* Fragmented handshake message */ | |||
| 2139 | pinfo->fragmented = true1; | |||
| 2140 | ||||
| 2141 | /* Don't pass the reassembly code data that doesn't exist */ | |||
| 2142 | tvb_ensure_bytes_exist(tvb, offset, fragment_length); | |||
| 2143 | ||||
| 2144 | if (dtls_fragment_limit_reached(pinfo, offset, frag_seq)) | |||
| 2145 | { | |||
| 2146 | expert_add_info(pinfo, fragment_length_item, &ei_dtls_handshake_too_many_fragments); | |||
| 2147 | frag_msg = NULL((void*)0); | |||
| 2148 | } | |||
| 2149 | else | |||
| 2150 | { | |||
| 2151 | frag_msg = fragment_add(&dtls_reassembly_table, | |||
| 2152 | tvb, offset, pinfo, frag_seq, NULL((void*)0), | |||
| 2153 | fragment_offset, fragment_length, true1); | |||
| 2154 | } | |||
| 2155 | /* | |||
| 2156 | * Do we already have a length for this reassembly? | |||
| 2157 | */ | |||
| 2158 | reassembled_length = fragment_get_tot_len(&dtls_reassembly_table, | |||
| 2159 | pinfo, frag_seq, NULL((void*)0)); | |||
| 2160 | if (reassembled_length == 0) | |||
| 2161 | { | |||
| 2162 | /* No - set it to the length specified by this packet. */ | |||
| 2163 | fragment_set_tot_len(&dtls_reassembly_table, | |||
| 2164 | pinfo, frag_seq, NULL((void*)0), length); | |||
| 2165 | } | |||
| 2166 | else | |||
| 2167 | { | |||
| 2168 | /* Yes - if this packet specifies a different length, | |||
| 2169 | report an error. */ | |||
| 2170 | if (reassembled_length != length) | |||
| 2171 | { | |||
| 2172 | expert_add_info(pinfo, length_item, &ei_dtls_msg_len_diff_fragment); | |||
| 2173 | } | |||
| 2174 | } | |||
| 2175 | ||||
| 2176 | if (frag_msg && (fragment_length + fragment_offset) == reassembled_length) | |||
| 2177 | { | |||
| 2178 | /* Reassembled */ | |||
| 2179 | new_tvb = process_reassembled_data(tvb, offset, pinfo, | |||
| 2180 | "Reassembled DTLS", | |||
| 2181 | frag_msg, | |||
| 2182 | &dtls_frag_items, | |||
| 2183 | NULL((void*)0), tree); | |||
| 2184 | frag_str = " (Reassembled)"; | |||
| 2185 | } | |||
| 2186 | else | |||
| 2187 | { | |||
| 2188 | frag_str = " (Fragment)"; | |||
| 2189 | } | |||
| 2190 | ||||
| 2191 | col_append_str(pinfo->cinfo, COL_INFO, frag_str); | |||
| 2192 | } | |||
| 2193 | } | |||
| 2194 | ||||
| 2195 | if (tree) | |||
| 2196 | { | |||
| 2197 | /* set the label text on the record layer expanding node */ | |||
| 2198 | if (first_iteration) | |||
| 2199 | { | |||
| 2200 | proto_item_set_text(tree, "%s Record Layer: %s Protocol: %s%s", | |||
| 2201 | val_to_str_const(session->version, ssl_version_short_names, "DTLS"), | |||
| 2202 | val_to_str_const(content_type, ssl_31_content_type, "unknown"), | |||
| 2203 | msg_type_str, (frag_str!=NULL((void*)0)) ? frag_str : ""); | |||
| 2204 | } | |||
| 2205 | else | |||
| 2206 | { | |||
| 2207 | proto_item_set_text(tree, "%s Record Layer: %s Protocol: %s%s", | |||
| 2208 | val_to_str_const(session->version, ssl_version_short_names, "DTLS"), | |||
| 2209 | val_to_str_const(content_type, ssl_31_content_type, "unknown"), | |||
| 2210 | "Multiple Handshake Messages", | |||
| 2211 | (frag_str!=NULL((void*)0)) ? frag_str : ""); | |||
| 2212 | } | |||
| 2213 | ||||
| 2214 | if (ssl_hand_tree) | |||
| 2215 | { | |||
| 2216 | /* set the text label on the subtree node */ | |||
| 2217 | proto_item_set_text(ssl_hand_tree, "Handshake Protocol: %s%s", | |||
| 2218 | msg_type_str, (frag_str!=NULL((void*)0)) ? frag_str : ""); | |||
| 2219 | } | |||
| 2220 | } | |||
| 2221 | ||||
| 2222 | if (fragmented && !new_tvb) | |||
| 2223 | { | |||
| 2224 | /* Skip fragmented messages not reassembled yet */ | |||
| 2225 | continue; | |||
| 2226 | } | |||
| 2227 | ||||
| 2228 | if (new_tvb) | |||
| 2229 | { | |||
| 2230 | sub_tvb = new_tvb; | |||
| 2231 | } | |||
| 2232 | else | |||
| 2233 | { | |||
| 2234 | sub_tvb = tvb_new_subset_length(tvb, offset, fragment_length); | |||
| 2235 | } | |||
| 2236 | ||||
| 2237 | if ((msg_type == SSL_HND_CLIENT_HELLO || msg_type == SSL_HND_SERVER_HELLO)) { | |||
| 2238 | if (msg_type == SSL_HND_CLIENT_HELLO) { | |||
| 2239 | tls_check_client_hello_random(ssl, sub_tvb, 0); | |||
| 2240 | } | |||
| 2241 | /* Prepare for renegotiation by resetting the state. */ | |||
| 2242 | ssl_reset_session(session, ssl, msg_type == SSL_HND_CLIENT_HELLO); | |||
| 2243 | } | |||
| 2244 | ||||
| 2245 | /* | |||
| 2246 | * Add handshake message (including type, length, etc.) to hash (for | |||
| 2247 | * Extended Master Secret). The computation must however happen as if | |||
| 2248 | * the message was sent in a single fragment (RFC 6347, section 4.2.6). | |||
| 2249 | */ | |||
| 2250 | /* XXX - DTLS 1.3's handshake transcript has the same format as TLS 1.3 | |||
| 2251 | * and lacks the DTLS specific fields (fragment info), unlike DTLS 1.2. | |||
| 2252 | * However, at the point of the ClientHello we don't know the version | |||
| 2253 | * the server will accept, which poses a problem. We might need to save | |||
| 2254 | * the transcript in the 1.2 format and then fix it up when 1.3 is | |||
| 2255 | * negotiated. | |||
| 2256 | */ | |||
| 2257 | if (fragment_offset == 0) { | |||
| 2258 | /* Unfragmented packet. */ | |||
| 2259 | ssl_calculate_handshake_hash(ssl, tvb, hs_offset, 12 + fragment_length, msg_type, is_from_server); | |||
| 2260 | } else { | |||
| 2261 | /* | |||
| 2262 | * Handshake message was fragmented over multiple messages, fake a | |||
| 2263 | * single fragment and add reassembled data. | |||
| 2264 | */ | |||
| 2265 | /* msg_type (1), length (3), message_seq (2) */ | |||
| 2266 | ssl_calculate_handshake_hash(ssl, tvb, hs_offset, 6, msg_type, is_from_server); | |||
| 2267 | /* fragment_offset (3) equals to zero. */ | |||
| 2268 | ssl_calculate_handshake_hash(ssl, NULL((void*)0), 0, 3, msg_type, is_from_server); | |||
| 2269 | /* fragment_length (3) equals to length. */ | |||
| 2270 | ssl_calculate_handshake_hash(ssl, tvb, hs_offset + 1, 3, msg_type, is_from_server); | |||
| 2271 | /* actual handshake data */ | |||
| 2272 | ssl_calculate_handshake_hash(ssl, sub_tvb, 0, length, msg_type, is_from_server); | |||
| 2273 | } | |||
| 2274 | ||||
| 2275 | /* now dissect the handshake message, if necessary */ | |||
| 2276 | switch ((HandshakeType) msg_type) { | |||
| 2277 | case SSL_HND_HELLO_REQUEST: | |||
| 2278 | /* hello_request has no fields, so nothing to do! */ | |||
| 2279 | break; | |||
| 2280 | ||||
| 2281 | case SSL_HND_CLIENT_HELLO: | |||
| 2282 | if (ssl) { | |||
| 2283 | /* ClientHello is first packet so set direction */ | |||
| 2284 | ssl_set_server(session, PINFO_DST(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_addr2 ((pinfo)->conv_addr_port_endpoints) : &((pinfo)->dst )), pinfo->ptype, PINFO_DESTPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port2 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->destport )); | |||
| 2285 | } | |||
| 2286 | ssl_dissect_hnd_cli_hello(&dissect_dtls_hf, sub_tvb, pinfo, | |||
| 2287 | ssl_hand_tree, 0, length, session, ssl, | |||
| 2288 | &dtls_hfs, NULL((void*)0)); | |||
| 2289 | if (ssl) { | |||
| 2290 | tls_save_crandom(ssl, tls_get_master_key_map(false0)); | |||
| 2291 | /* force DTLSv1.3 version if early data is seen */ | |||
| 2292 | if (ssl->has_early_data) { | |||
| 2293 | session->version = DTLSV1DOT3_VERSION0xfefc; | |||
| 2294 | ssl->state |= SSL_VERSION(1<<4); | |||
| 2295 | ssl_debug_printf("%s forcing version 0x%04X -> state 0x%02X\n", G_STRFUNC((const char*) (__func__)), DTLSV1DOT3_VERSION0xfefc, ssl->state); | |||
| 2296 | } | |||
| 2297 | } | |||
| 2298 | break; | |||
| 2299 | ||||
| 2300 | case SSL_HND_SERVER_HELLO: | |||
| 2301 | tls_scan_server_hello(sub_tvb, 0, length, &version, &is_hrr); | |||
| 2302 | ssl_try_set_version(session, ssl, SSL_ID_HANDSHAKE, SSL_HND_SERVER_HELLO, true1, version); | |||
| 2303 | ||||
| 2304 | ssl_dissect_hnd_srv_hello(&dissect_dtls_hf, sub_tvb, pinfo, ssl_hand_tree, | |||
| 2305 | 0, length, session, ssl, true1, is_hrr); | |||
| 2306 | if (ssl) { | |||
| 2307 | if (ssl->has_psk && !ssl->has_key_share) { | |||
| 2308 | // Server negotiated psk_ke; load the PSK if we have one. | |||
| 2309 | tls_load_psk(ssl, dtls_options.psk); | |||
| 2310 | } | |||
| 2311 | } | |||
| 2312 | break; | |||
| 2313 | ||||
| 2314 | case SSL_HND_HELLO_VERIFY_REQUEST: | |||
| 2315 | /* | |||
| 2316 | * The initial ClientHello and HelloVerifyRequest are not included | |||
| 2317 | * in the calculation of the handshake_messages | |||
| 2318 | * (https://tools.ietf.org/html/rfc6347#page-18). This is also | |||
| 2319 | * important for correct calculation of Extended Master Secret. | |||
| 2320 | */ | |||
| 2321 | if (ssl) { | |||
| 2322 | ssl_debug_printf("%s erasing previous handshake_messages\n", G_STRFUNC((const char*) (__func__))); | |||
| 2323 | tls_transcript_reset(&ssl->handshake_transcript); | |||
| 2324 | } | |||
| 2325 | dissect_dtls_hnd_hello_verify_request(&dissect_dtls_hf, sub_tvb, pinfo, | |||
| 2326 | ssl_hand_tree, 0, length); | |||
| 2327 | break; | |||
| 2328 | ||||
| 2329 | case SSL_HND_NEWSESSION_TICKET: | |||
| 2330 | /* no need to load keylog file here as it only links a previous | |||
| 2331 | * master key with this Session Ticket */ | |||
| 2332 | ssl_dissect_hnd_new_ses_ticket(&dissect_dtls_hf, sub_tvb, pinfo, | |||
| 2333 | ssl_hand_tree, 0, length, session, ssl, true1, | |||
| 2334 | tls_get_master_key_map(false0)->tickets); | |||
| 2335 | break; | |||
| 2336 | ||||
| 2337 | case SSL_HND_HELLO_RETRY_REQUEST: | |||
| 2338 | ssl_dissect_hnd_hello_retry_request(&dissect_dtls_hf, sub_tvb, pinfo, ssl_hand_tree, | |||
| 2339 | 0, length, session, ssl, true1); | |||
| 2340 | break; | |||
| 2341 | ||||
| 2342 | case SSL_HND_CERTIFICATE: | |||
| 2343 | ssl_dissect_hnd_cert(&dissect_dtls_hf, sub_tvb, ssl_hand_tree, 0, length, | |||
| 2344 | pinfo, session, ssl, is_from_server, true1); | |||
| 2345 | break; | |||
| 2346 | ||||
| 2347 | case SSL_HND_SERVER_KEY_EXCHG: | |||
| 2348 | ssl_dissect_hnd_srv_keyex(&dissect_dtls_hf, sub_tvb, pinfo, ssl_hand_tree, 0, length, session); | |||
| 2349 | break; | |||
| 2350 | ||||
| 2351 | case SSL_HND_CERT_REQUEST: | |||
| 2352 | ssl_dissect_hnd_cert_req(&dissect_dtls_hf, sub_tvb, pinfo, ssl_hand_tree, 0, length, session, true1); | |||
| 2353 | break; | |||
| 2354 | ||||
| 2355 | case SSL_HND_SVR_HELLO_DONE: | |||
| 2356 | /* This is not an abbreviated handshake, it is certainly not resumed. */ | |||
| 2357 | session->is_session_resumed = false0; | |||
| 2358 | break; | |||
| 2359 | ||||
| 2360 | case SSL_HND_CERT_VERIFY: | |||
| 2361 | ssl_dissect_hnd_cli_cert_verify(&dissect_dtls_hf, sub_tvb, pinfo, ssl_hand_tree, 0, length, session->version); | |||
| 2362 | break; | |||
| 2363 | ||||
| 2364 | case SSL_HND_CLIENT_KEY_EXCHG: | |||
| 2365 | ssl_dissect_hnd_cli_keyex(&dissect_dtls_hf, sub_tvb, ssl_hand_tree, 0, length, session); | |||
| 2366 | if (!ssl) | |||
| 2367 | break; | |||
| 2368 | ||||
| 2369 | /* try to find master key from pre-master key */ | |||
| 2370 | if (!ssl_generate_pre_master_secret(ssl, length, sub_tvb, 0, | |||
| 2371 | dtls_options.psk, pinfo, | |||
| 2372 | #ifdef HAVE_LIBGNUTLS1 | |||
| 2373 | dtls_key_hash, | |||
| 2374 | #endif | |||
| 2375 | tls_get_master_key_map(true1))) { | |||
| 2376 | ssl_debug_printf("dissect_dtls_handshake can't generate pre master secret\n"); | |||
| 2377 | } | |||
| 2378 | break; | |||
| 2379 | ||||
| 2380 | case SSL_HND_FINISHED: | |||
| 2381 | ssl_dissect_hnd_finished(&dissect_dtls_hf, sub_tvb, ssl_hand_tree, | |||
| 2382 | 0, length, session, NULL((void*)0)); | |||
| 2383 | break; | |||
| 2384 | ||||
| 2385 | case SSL_HND_CERT_STATUS: | |||
| 2386 | tls_dissect_hnd_certificate_status(&dissect_dtls_hf, sub_tvb, pinfo, ssl_hand_tree, 0, length); | |||
| 2387 | break; | |||
| 2388 | ||||
| 2389 | case SSL_HND_CERT_URL: | |||
| 2390 | case SSL_HND_SUPPLEMENTAL_DATA: | |||
| 2391 | case SSL_HND_KEY_UPDATE: | |||
| 2392 | tls13_dissect_hnd_key_update(&dissect_dtls_hf, sub_tvb, ssl_hand_tree, 0); | |||
| 2393 | if (ssl && ssl->session.version == DTLSV1DOT3_VERSION0xfefc) { | |||
| 2394 | dtls13_maybe_increase_max_epoch(ssl, is_from_server); | |||
| 2395 | } | |||
| 2396 | break; | |||
| 2397 | case SSL_HND_ENCRYPTED_EXTS: | |||
| 2398 | case SSL_HND_END_OF_EARLY_DATA: /* TLS 1.3 */ | |||
| 2399 | case SSL_HND_COMPRESSED_CERTIFICATE: | |||
| 2400 | case SSL_HND_MESSAGE_HASH: | |||
| 2401 | break; | |||
| 2402 | case SSL_HND_ENCRYPTED_EXTENSIONS: /* TLS 1.3 */ | |||
| 2403 | ssl_dissect_hnd_encrypted_extensions(&dissect_dtls_hf, sub_tvb, pinfo, ssl_hand_tree, 0, length, session, ssl, 1); | |||
| 2404 | break; | |||
| 2405 | } | |||
| 2406 | } | |||
| 2407 | } | |||
| 2408 | ||||
| 2409 | /* dissects the heartbeat message, filling in the tree */ | |||
| 2410 | static void | |||
| 2411 | dissect_dtls_heartbeat(tvbuff_t *tvb, packet_info *pinfo, | |||
| 2412 | proto_tree *tree, uint32_t offset, | |||
| 2413 | const SslSession *session, uint32_t record_length, | |||
| 2414 | bool_Bool decrypted) | |||
| 2415 | { | |||
| 2416 | /* struct { | |||
| 2417 | * HeartbeatMessageType type; | |||
| 2418 | * uint16 payload_length; | |||
| 2419 | * opaque payload; | |||
| 2420 | * opaque padding; | |||
| 2421 | * } HeartbeatMessage; | |||
| 2422 | */ | |||
| 2423 | ||||
| 2424 | proto_tree *ti; | |||
| 2425 | proto_tree *dtls_heartbeat_tree; | |||
| 2426 | const char *type; | |||
| 2427 | uint8_t byte; | |||
| 2428 | uint16_t payload_length; | |||
| 2429 | uint16_t padding_length; | |||
| 2430 | bool_Bool plausible; | |||
| 2431 | ||||
| 2432 | ti = proto_tree_add_item(tree, hf_dtls_heartbeat_message, tvb, | |||
| 2433 | offset, record_length, ENC_NA0x00000000); | |||
| 2434 | dtls_heartbeat_tree = proto_item_add_subtree(ti, ett_dtls_heartbeat); | |||
| 2435 | ||||
| 2436 | /* | |||
| 2437 | * set the record layer label | |||
| 2438 | */ | |||
| 2439 | ||||
| 2440 | /* first lookup the names for the message type and the payload length */ | |||
| 2441 | byte = tvb_get_uint8(tvb, offset); | |||
| 2442 | type = try_val_to_str(byte, tls_heartbeat_type); | |||
| 2443 | ||||
| 2444 | payload_length = tvb_get_ntohs(tvb, offset + 1); | |||
| 2445 | padding_length = record_length - 3 - payload_length; | |||
| 2446 | /* type (1), length (2), payload and at least 16 bytes of padding */ | |||
| 2447 | plausible = 3u + payload_length + 16 <= record_length; | |||
| 2448 | ||||
| 2449 | /* now set the text in the record layer line */ | |||
| 2450 | if (type && plausible) { | |||
| 2451 | col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL((void*)0), "Heartbeat %s", type); | |||
| 2452 | } else { | |||
| 2453 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), "Encrypted Heartbeat"); | |||
| 2454 | } | |||
| 2455 | ||||
| 2456 | if (tree) { | |||
| 2457 | if (type && (plausible || decrypted)) { | |||
| 2458 | proto_item_set_text(tree, "%s Record Layer: Heartbeat " | |||
| 2459 | "%s", | |||
| 2460 | val_to_str_const(session->version, ssl_version_short_names, "DTLS"), | |||
| 2461 | type); | |||
| 2462 | proto_tree_add_item(dtls_heartbeat_tree, hf_dtls_heartbeat_message_type, | |||
| 2463 | tvb, offset, 1, ENC_BIG_ENDIAN0x00000000); | |||
| 2464 | offset += 1; | |||
| 2465 | ti = proto_tree_add_uint(dtls_heartbeat_tree, hf_dtls_heartbeat_message_payload_length, | |||
| 2466 | tvb, offset, 2, payload_length); | |||
| 2467 | offset += 2; | |||
| 2468 | if (!plausible) { | |||
| 2469 | expert_add_info_format(pinfo, ti, &ei_dtls_heartbeat_payload_length, | |||
| 2470 | "Invalid heartbeat payload length (%d)", payload_length); | |||
| 2471 | /* Invalid heartbeat payload length, adjust to try decoding */ | |||
| 2472 | if (record_length >= 3 + 16) { | |||
| 2473 | payload_length = record_length - 16 - 3; | |||
| 2474 | padding_length = 16; | |||
| 2475 | } else { | |||
| 2476 | payload_length = 0; | |||
| 2477 | padding_length = record_length > 3 ? record_length - 3 : 0; | |||
| 2478 | } | |||
| 2479 | proto_item_append_text (ti, " (invalid, using %u to decode payload)", payload_length); | |||
| 2480 | ||||
| 2481 | } | |||
| 2482 | proto_tree_add_bytes_format(dtls_heartbeat_tree, hf_dtls_heartbeat_message_payload, | |||
| 2483 | tvb, offset, payload_length, | |||
| 2484 | NULL((void*)0), "Payload (%u byte%s)", | |||
| 2485 | payload_length, | |||
| 2486 | plurality(payload_length, "", "s")((payload_length) == 1 ? ("") : ("s"))); | |||
| 2487 | offset += payload_length; | |||
| 2488 | proto_tree_add_bytes_format(dtls_heartbeat_tree, hf_dtls_heartbeat_message_padding, | |||
| 2489 | tvb, offset, padding_length, | |||
| 2490 | NULL((void*)0), "Padding and HMAC (%u byte%s)", | |||
| 2491 | padding_length, | |||
| 2492 | plurality(padding_length, "", "s")((padding_length) == 1 ? ("") : ("s"))); | |||
| 2493 | } else { | |||
| 2494 | proto_item_set_text(tree, | |||
| 2495 | "%s Record Layer: Encrypted Heartbeat", | |||
| 2496 | val_to_str_const(session->version, ssl_version_short_names, "DTLS")); | |||
| 2497 | proto_item_set_text(dtls_heartbeat_tree, | |||
| 2498 | "Encrypted Heartbeat Message"); | |||
| 2499 | } | |||
| 2500 | } | |||
| 2501 | } | |||
| 2502 | ||||
| 2503 | /* dissects the acknowledgement message from RFC 9147 section 7 */ | |||
| 2504 | static void | |||
| 2505 | dissect_dtls_ack(tvbuff_t *tvb, packet_info *pinfo, | |||
| 2506 | proto_tree *tree, uint32_t offset, | |||
| 2507 | uint32_t record_length) | |||
| 2508 | { | |||
| 2509 | /* | |||
| 2510 | * section 4: | |||
| 2511 | * struct { | |||
| 2512 | * uint64 epoch; | |||
| 2513 | * uint64 sequence_number; | |||
| 2514 | * } RecordNumber; | |||
| 2515 | * | |||
| 2516 | * section 7: | |||
| 2517 | * struct { | |||
| 2518 | * RecordNumber record_numbers<0..2^16-1>; | |||
| 2519 | * } ACK; | |||
| 2520 | */ | |||
| 2521 | ||||
| 2522 | uint32_t i; | |||
| 2523 | uint32_t record_number_length; | |||
| 2524 | proto_tree *ti; | |||
| 2525 | proto_tree *dtls_ack_tree, *rn_tree; | |||
| 2526 | uint64_t epoch; | |||
| 2527 | uint64_t number; | |||
| 2528 | ||||
| 2529 | col_append_sep_str(pinfo->cinfo, COL_INFO, NULL((void*)0), "Acknowledgement"); | |||
| 2530 | ti = proto_tree_add_item(tree, hf_dtls_ack_message, tvb, | |||
| 2531 | offset, record_length, ENC_NA0x00000000); | |||
| 2532 | dtls_ack_tree = proto_item_add_subtree(ti, ett_dtls_ack); | |||
| 2533 | ||||
| 2534 | /* record_numbers<2..2^16-2> */ | |||
| 2535 | if (!ssl_add_vector(&dissect_dtls_hf, tvb, pinfo, dtls_ack_tree, offset, offset + record_length, &record_number_length, | |||
| 2536 | hf_dtls_ack_record_numbers_length, 2, UINT16_MAX(65535) - 1)) { | |||
| 2537 | return; | |||
| 2538 | } | |||
| 2539 | ||||
| 2540 | offset += 2; | |||
| 2541 | ti = proto_tree_add_none_format(dtls_ack_tree, hf_dtls_ack_record_numbers, tvb, offset, record_number_length, | |||
| 2542 | "Record Numbers (%u record number%s)", | |||
| 2543 | record_number_length / 16, plurality(record_number_length / 16, "", "s")((record_number_length / 16) == 1 ? ("") : ("s"))); | |||
| 2544 | dtls_ack_tree = proto_item_add_subtree(ti, ett_dtls_ack_record_numbers); | |||
| 2545 | ||||
| 2546 | for (i = 0; i < record_number_length; i += 16) { | |||
| 2547 | rn_tree = proto_tree_add_subtree(dtls_ack_tree, tvb, offset + i, 16, ett_dtls_ack_record_number, NULL((void*)0), ""); | |||
| 2548 | proto_tree_add_item_ret_uint64(rn_tree, hf_dtls_record_epoch64, tvb, | |||
| 2549 | offset + i + 0, 8, ENC_BIG_ENDIAN0x00000000, &epoch); | |||
| 2550 | proto_tree_add_item_ret_uint64(rn_tree, hf_dtls_record_sequence_number, tvb, | |||
| 2551 | offset + i + 8, 8, ENC_BIG_ENDIAN0x00000000, &number); | |||
| 2552 | proto_item_set_text(rn_tree, "Record Number: epoch %" PRIu64"l" "u" ", sequence number %" PRIu64"l" "u", epoch, number); | |||
| 2553 | } | |||
| 2554 | } | |||
| 2555 | ||||
| 2556 | static int | |||
| 2557 | dissect_dtls_hnd_hello_verify_request(ssl_common_dissect_t *hf, tvbuff_t *tvb, | |||
| 2558 | packet_info *pinfo, proto_tree *tree, | |||
| 2559 | uint32_t offset, uint32_t offset_end) | |||
| 2560 | { | |||
| 2561 | /* | |||
| 2562 | * struct { | |||
| 2563 | * ProtocolVersion server_version; | |||
| 2564 | * opaque cookie<0..32>; | |||
| 2565 | * } HelloVerifyRequest; | |||
| 2566 | */ | |||
| 2567 | ||||
| 2568 | uint32_t cookie_length; | |||
| 2569 | ||||
| 2570 | /* show the client version */ | |||
| 2571 | proto_tree_add_item(tree, dissect_dtls_hf.hf.hs_server_version, tvb, | |||
| 2572 | offset, 2, ENC_BIG_ENDIAN0x00000000); | |||
| 2573 | offset += 2; | |||
| 2574 | ||||
| 2575 | if (!ssl_add_vector(hf, tvb, pinfo, tree, offset, offset_end, &cookie_length, | |||
| 2576 | dtls_hfs.hf_dtls_handshake_cookie_len, 0, 32)) { | |||
| 2577 | return offset; | |||
| 2578 | } | |||
| 2579 | offset++; | |||
| 2580 | ||||
| 2581 | if (cookie_length > 0) | |||
| 2582 | { | |||
| 2583 | proto_tree_add_item(tree, dtls_hfs.hf_dtls_handshake_cookie, | |||
| 2584 | tvb, offset, cookie_length, ENC_NA0x00000000); | |||
| 2585 | offset += cookie_length; | |||
| 2586 | } | |||
| 2587 | ||||
| 2588 | return offset; | |||
| 2589 | } | |||
| 2590 | ||||
| 2591 | int | |||
| 2592 | dtls_dissect_hnd_hello_ext_use_srtp(packet_info *pinfo, tvbuff_t *tvb, | |||
| 2593 | proto_tree *tree, uint32_t offset, | |||
| 2594 | uint32_t ext_len, bool_Bool is_server) | |||
| 2595 | { | |||
| 2596 | /* From https://tools.ietf.org/html/rfc5764#section-4.1.1 | |||
| 2597 | * | |||
| 2598 | * uint8 SRTPProtectionProfile[2]; | |||
| 2599 | * | |||
| 2600 | * struct { | |||
| 2601 | * SRTPProtectionProfiles SRTPProtectionProfiles; | |||
| 2602 | * opaque srtp_mki<0..255>; | |||
| 2603 | * } UseSRTPData; | |||
| 2604 | * | |||
| 2605 | * SRTPProtectionProfile SRTPProtectionProfiles<2..2^16-1>; | |||
| 2606 | */ | |||
| 2607 | ||||
| 2608 | proto_item *ti; | |||
| 2609 | uint32_t profiles_length, profiles_end, profile, mki_length; | |||
| ||||
| 2610 | ||||
| 2611 | if (ext_len < 2) { | |||
| 2612 | /* XXX expert info, record too small */ | |||
| 2613 | return offset + ext_len; | |||
| 2614 | } | |||
| 2615 | ||||
| 2616 | /* SRTPProtectionProfiles list length */ | |||
| 2617 | ti = proto_tree_add_item_ret_uint(tree, hf_dtls_hs_ext_use_srtp_protection_profiles_length, | |||
| 2618 | tvb, offset, 2, ENC_BIG_ENDIAN0x00000000, &profiles_length); | |||
| 2619 | if (profiles_length > ext_len - 2) { | |||
| 2620 | profiles_length = ext_len - 2; | |||
| 2621 | expert_add_info_format(pinfo, ti, &ei_dtls_use_srtp_profiles_length, | |||
| 2622 | "The protection profiles length exceeds the extension data field length"); | |||
| 2623 | } | |||
| 2624 | if (is_server && profiles_length != 2) { | |||
| 2625 | /* The server, if sending the use_srtp extension, MUST return a | |||
| 2626 | * a single chosen profile that the client has offered. | |||
| 2627 | */ | |||
| 2628 | profile = SRTP_PROFILE_RESERVED0x0000; | |||
| 2629 | expert_add_info_format(pinfo, ti, &ei_dtls_use_srtp_profiles_length, | |||
| 2630 | "The server MUST return a single chosen protection profile"); | |||
| 2631 | } | |||
| 2632 | offset += 2; | |||
| 2633 | ||||
| 2634 | /* SRTPProtectionProfiles list items */ | |||
| 2635 | profiles_end = offset + profiles_length; | |||
| 2636 | while (offset < profiles_end) { | |||
| 2637 | proto_tree_add_item_ret_uint(tree, | |||
| 2638 | hf_dtls_hs_ext_use_srtp_protection_profile, tvb, offset, 2, | |||
| 2639 | ENC_BIG_ENDIAN0x00000000, &profile); | |||
| 2640 | offset += 2; | |||
| 2641 | } | |||
| 2642 | ||||
| 2643 | /* MKI */ | |||
| 2644 | proto_tree_add_item_ret_uint(tree, hf_dtls_hs_ext_use_srtp_mki_length, | |||
| 2645 | tvb, offset, 1, ENC_NA0x00000000, &mki_length); | |||
| 2646 | offset++; | |||
| 2647 | if (mki_length > 0) { | |||
| 2648 | proto_tree_add_item(tree, hf_dtls_hs_ext_use_srtp_mki, | |||
| 2649 | tvb, offset, mki_length, ENC_NA0x00000000); | |||
| 2650 | offset += mki_length; | |||
| 2651 | } | |||
| 2652 | ||||
| 2653 | /* We don't know which SRTP protection profile is chosen, unless only one | |||
| 2654 | * was provided. | |||
| 2655 | */ | |||
| 2656 | if (is_server
| |||
| 2657 | struct srtp_info *srtp_info = wmem_new0(wmem_file_scope(), struct srtp_info)((struct srtp_info*)wmem_alloc0((wmem_file_scope()), sizeof(struct srtp_info))); | |||
| 2658 | switch(profile) { | |||
| ||||
| 2659 | case SRTP_AES128_CM_HMAC_SHA1_800x0001: | |||
| 2660 | srtp_info->encryption_algorithm = SRTP_ENC_ALG_AES_CM2; | |||
| 2661 | srtp_info->auth_algorithm = SRTP_AUTH_ALG_HMAC_SHA11; | |||
| 2662 | srtp_info->auth_tag_len = 10; | |||
| 2663 | break; | |||
| 2664 | case SRTP_AES128_CM_HMAC_SHA1_320x0002: | |||
| 2665 | srtp_info->encryption_algorithm = SRTP_ENC_ALG_AES_CM2; | |||
| 2666 | srtp_info->auth_algorithm = SRTP_AUTH_ALG_HMAC_SHA11; | |||
| 2667 | srtp_info->auth_tag_len = 4; | |||
| 2668 | break; | |||
| 2669 | case SRTP_NULL_HMAC_SHA1_800x0005: | |||
| 2670 | srtp_info->encryption_algorithm = SRTP_ENC_ALG_NULL1; | |||
| 2671 | srtp_info->auth_algorithm = SRTP_AUTH_ALG_HMAC_SHA11; | |||
| 2672 | srtp_info->auth_tag_len = 10; | |||
| 2673 | break; | |||
| 2674 | case SRTP_NULL_HMAC_SHA1_320x0006: | |||
| 2675 | srtp_info->encryption_algorithm = SRTP_ENC_ALG_NULL1; | |||
| 2676 | srtp_info->auth_algorithm = SRTP_AUTH_ALG_HMAC_SHA11; | |||
| 2677 | srtp_info->auth_tag_len = 4; | |||
| 2678 | break; | |||
| 2679 | case SRTP_AEAD_AES_128_GCM0x0007: | |||
| 2680 | srtp_info->encryption_algorithm = SRTP_ENC_ALG_AES_CM2; | |||
| 2681 | srtp_info->auth_algorithm = SRTP_AUTH_ALG_GMAC2; | |||
| 2682 | srtp_info->auth_tag_len = 16; | |||
| 2683 | break; | |||
| 2684 | case SRTP_AEAD_AES_256_GCM0x0008: | |||
| 2685 | srtp_info->encryption_algorithm = SRTP_ENC_ALG_AES_CM2; | |||
| 2686 | srtp_info->auth_algorithm = SRTP_AUTH_ALG_GMAC2; | |||
| 2687 | srtp_info->auth_tag_len = 16; | |||
| 2688 | break; | |||
| 2689 | default: | |||
| 2690 | srtp_info->encryption_algorithm = SRTP_ENC_ALG_AES_CM2; | |||
| 2691 | srtp_info->auth_algorithm = SRTP_AUTH_ALG_HMAC_SHA11; | |||
| 2692 | srtp_info->auth_tag_len = 10; | |||
| 2693 | } | |||
| 2694 | srtp_info->mki_len = mki_length; | |||
| 2695 | /* RFC 5764: It is RECOMMENDED that symmetric RTP be used with DTLS-SRTP. | |||
| 2696 | * RTP and RTCP traffic MAY be multiplexed on a single UDP port. (RFC 5761) | |||
| 2697 | * | |||
| 2698 | * XXX: This creates a new RTP conversation. What it _should_ do is update | |||
| 2699 | * a RTP conversation initiated by SDP in a previous frame with the | |||
| 2700 | * srtp_info. Assuming we got the SDP and decrypted it if over TLS, etc. | |||
| 2701 | * However, since we don't actually decrypt SRT[C]P yet, the information | |||
| 2702 | * carried in the SDP about payload and media types isn't that useful. | |||
| 2703 | * (Being able to have the stream refer back to both the DTLS-SRTP and | |||
| 2704 | * SDP setup frame might be useful, though.) | |||
| 2705 | */ | |||
| 2706 | srtp_add_address(pinfo, PT_UDP, PINFO_NET_SRC(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_addr1 ((pinfo)->conv_addr_port_endpoints) : &((pinfo)->net_src )), PINFO_SRCPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port1 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->srcport), PINFO_DESTPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port2 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->destport ), "DTLS-SRTP", pinfo->num, RTP_MEDIA_AUDIO1, NULL((void*)0), srtp_info, NULL((void*)0)); | |||
| 2707 | srtp_add_address(pinfo, PT_UDP, PINFO_NET_DST(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_addr2 ((pinfo)->conv_addr_port_endpoints) : &((pinfo)->net_dst )), PINFO_DESTPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port2 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->destport ), PINFO_SRCPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port1 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->srcport), "DTLS-SRTP", pinfo->num, RTP_MEDIA_AUDIO1, NULL((void*)0), srtp_info, NULL((void*)0)); | |||
| 2708 | } | |||
| 2709 | return offset; | |||
| 2710 | } | |||
| 2711 | ||||
| 2712 | /********************************************************************* | |||
| 2713 | * | |||
| 2714 | * Support Functions | |||
| 2715 | * | |||
| 2716 | *********************************************************************/ | |||
| 2717 | ||||
| 2718 | /* this applies a heuristic to determine whether | |||
| 2719 | * or not the data beginning at offset looks like a | |||
| 2720 | * valid dtls record. | |||
| 2721 | */ | |||
| 2722 | static int | |||
| 2723 | looks_like_dtls(tvbuff_t *tvb, uint32_t offset) | |||
| 2724 | { | |||
| 2725 | /* have to have a valid content type followed by a valid | |||
| 2726 | * protocol version | |||
| 2727 | */ | |||
| 2728 | uint8_t byte; | |||
| 2729 | uint16_t version; | |||
| 2730 | ||||
| 2731 | /* see if the first byte is a valid content type */ | |||
| 2732 | byte = tvb_get_uint8(tvb, offset); | |||
| 2733 | if (!ssl_is_valid_content_type(byte)) | |||
| 2734 | { | |||
| 2735 | if ((byte & DTLS13_FIXED_MASK0xE0) >> 5 == 1) { | |||
| 2736 | return 1; | |||
| 2737 | } | |||
| 2738 | return 0; | |||
| 2739 | } | |||
| 2740 | ||||
| 2741 | /* now check to see if the version byte appears valid */ | |||
| 2742 | version = tvb_get_ntohs(tvb, offset + 1); | |||
| 2743 | if (version != DTLSV1DOT0_VERSION0xfeff && version != DTLSV1DOT2_VERSION0xfefd && | |||
| 2744 | version != DTLSV1DOT0_OPENSSL_VERSION0x100) | |||
| 2745 | { | |||
| 2746 | return 0; | |||
| 2747 | } | |||
| 2748 | ||||
| 2749 | return 1; | |||
| 2750 | } | |||
| 2751 | ||||
| 2752 | /* UAT */ | |||
| 2753 | ||||
| 2754 | #if defined(HAVE_LIBGNUTLS1) | |||
| 2755 | static void | |||
| 2756 | dtlsdecrypt_free_cb(void* r) | |||
| 2757 | { | |||
| 2758 | ssldecrypt_assoc_t* h = (ssldecrypt_assoc_t*)r; | |||
| 2759 | ||||
| 2760 | g_free(h->ipaddr)(__builtin_object_size ((h->ipaddr), 0) != ((size_t) - 1)) ? g_free_sized (h->ipaddr, __builtin_object_size ((h-> ipaddr), 0)) : (g_free) (h->ipaddr); | |||
| 2761 | g_free(h->port)(__builtin_object_size ((h->port), 0) != ((size_t) - 1)) ? g_free_sized (h->port, __builtin_object_size ((h->port ), 0)) : (g_free) (h->port); | |||
| 2762 | g_free(h->protocol)(__builtin_object_size ((h->protocol), 0) != ((size_t) - 1 )) ? g_free_sized (h->protocol, __builtin_object_size ((h-> protocol), 0)) : (g_free) (h->protocol); | |||
| 2763 | g_free(h->keyfile)(__builtin_object_size ((h->keyfile), 0) != ((size_t) - 1) ) ? g_free_sized (h->keyfile, __builtin_object_size ((h-> keyfile), 0)) : (g_free) (h->keyfile); | |||
| 2764 | g_free(h->password)(__builtin_object_size ((h->password), 0) != ((size_t) - 1 )) ? g_free_sized (h->password, __builtin_object_size ((h-> password), 0)) : (g_free) (h->password); | |||
| 2765 | } | |||
| 2766 | #endif | |||
| 2767 | ||||
| 2768 | #if 0 | |||
| 2769 | static void | |||
| 2770 | dtlsdecrypt_update_cb(void* r _U___attribute__((unused)), const char** err _U___attribute__((unused))) | |||
| 2771 | { | |||
| 2772 | return; | |||
| 2773 | } | |||
| 2774 | #endif | |||
| 2775 | ||||
| 2776 | #if defined(HAVE_LIBGNUTLS1) | |||
| 2777 | static void * | |||
| 2778 | dtlsdecrypt_copy_cb(void* dest, const void* orig, size_t len _U___attribute__((unused))) | |||
| 2779 | { | |||
| 2780 | const ssldecrypt_assoc_t* o = (const ssldecrypt_assoc_t*)orig; | |||
| 2781 | ssldecrypt_assoc_t* d = (ssldecrypt_assoc_t*)dest; | |||
| 2782 | ||||
| 2783 | d->ipaddr = g_strdup(o->ipaddr)g_strdup_inline (o->ipaddr); | |||
| 2784 | d->port = g_strdup(o->port)g_strdup_inline (o->port); | |||
| 2785 | d->protocol = g_strdup(o->protocol)g_strdup_inline (o->protocol); | |||
| 2786 | d->keyfile = g_strdup(o->keyfile)g_strdup_inline (o->keyfile); | |||
| 2787 | d->password = g_strdup(o->password)g_strdup_inline (o->password); | |||
| 2788 | ||||
| 2789 | return d; | |||
| 2790 | } | |||
| 2791 | ||||
| 2792 | UAT_CSTRING_CB_DEF(sslkeylist_uats,ipaddr,ssldecrypt_assoc_t)static void sslkeylist_uats_ipaddr_set_cb(void* rec, const char * buf, unsigned len, const void* u1 __attribute__((unused)), const void* u2 __attribute__((unused))) { char* new_buf = g_strndup (buf,len); (__builtin_object_size (((((ssldecrypt_assoc_t*)rec )->ipaddr)), 0) != ((size_t) - 1)) ? g_free_sized ((((ssldecrypt_assoc_t *)rec)->ipaddr), __builtin_object_size (((((ssldecrypt_assoc_t *)rec)->ipaddr)), 0)) : (g_free) ((((ssldecrypt_assoc_t*)rec )->ipaddr)); (((ssldecrypt_assoc_t*)rec)->ipaddr) = new_buf ; } static void sslkeylist_uats_ipaddr_tostr_cb(void* rec, char ** out_ptr, unsigned* out_len, const void* u1 __attribute__(( unused)), const void* u2 __attribute__((unused))) { if (((ssldecrypt_assoc_t *)rec)->ipaddr ) { *out_ptr = g_strdup_inline ((((ssldecrypt_assoc_t *)rec)->ipaddr)); *out_len = (unsigned)strlen((((ssldecrypt_assoc_t *)rec)->ipaddr)); } else { *out_ptr = g_strdup_inline ("") ; *out_len = 0; } } | |||
| 2793 | UAT_CSTRING_CB_DEF(sslkeylist_uats,port,ssldecrypt_assoc_t)static void sslkeylist_uats_port_set_cb(void* rec, const char * buf, unsigned len, const void* u1 __attribute__((unused)), const void* u2 __attribute__((unused))) { char* new_buf = g_strndup (buf,len); (__builtin_object_size (((((ssldecrypt_assoc_t*)rec )->port)), 0) != ((size_t) - 1)) ? g_free_sized ((((ssldecrypt_assoc_t *)rec)->port), __builtin_object_size (((((ssldecrypt_assoc_t *)rec)->port)), 0)) : (g_free) ((((ssldecrypt_assoc_t*)rec )->port)); (((ssldecrypt_assoc_t*)rec)->port) = new_buf ; } static void sslkeylist_uats_port_tostr_cb(void* rec, char ** out_ptr, unsigned* out_len, const void* u1 __attribute__(( unused)), const void* u2 __attribute__((unused))) { if (((ssldecrypt_assoc_t *)rec)->port ) { *out_ptr = g_strdup_inline ((((ssldecrypt_assoc_t *)rec)->port)); *out_len = (unsigned)strlen((((ssldecrypt_assoc_t *)rec)->port)); } else { *out_ptr = g_strdup_inline (""); * out_len = 0; } } | |||
| 2794 | UAT_CSTRING_CB_DEF(sslkeylist_uats,protocol,ssldecrypt_assoc_t)static void sslkeylist_uats_protocol_set_cb(void* rec, const char * buf, unsigned len, const void* u1 __attribute__((unused)), const void* u2 __attribute__((unused))) { char* new_buf = g_strndup (buf,len); (__builtin_object_size (((((ssldecrypt_assoc_t*)rec )->protocol)), 0) != ((size_t) - 1)) ? g_free_sized ((((ssldecrypt_assoc_t *)rec)->protocol), __builtin_object_size (((((ssldecrypt_assoc_t *)rec)->protocol)), 0)) : (g_free) ((((ssldecrypt_assoc_t* )rec)->protocol)); (((ssldecrypt_assoc_t*)rec)->protocol ) = new_buf; } static void sslkeylist_uats_protocol_tostr_cb( void* rec, char** out_ptr, unsigned* out_len, const void* u1 __attribute__ ((unused)), const void* u2 __attribute__((unused))) { if (((ssldecrypt_assoc_t *)rec)->protocol ) { *out_ptr = g_strdup_inline ((((ssldecrypt_assoc_t *)rec)->protocol)); *out_len = (unsigned)strlen((((ssldecrypt_assoc_t *)rec)->protocol)); } else { *out_ptr = g_strdup_inline ("" ); *out_len = 0; } } | |||
| 2795 | UAT_FILENAME_CB_DEF(sslkeylist_uats,keyfile,ssldecrypt_assoc_t)static void sslkeylist_uats_keyfile_set_cb(void* rec, const char * buf, unsigned len, const void* u1 __attribute__((unused)), const void* u2 __attribute__((unused))) { char* new_buf = g_strndup (buf,len); (__builtin_object_size (((((ssldecrypt_assoc_t*)rec )->keyfile)), 0) != ((size_t) - 1)) ? g_free_sized ((((ssldecrypt_assoc_t *)rec)->keyfile), __builtin_object_size (((((ssldecrypt_assoc_t *)rec)->keyfile)), 0)) : (g_free) ((((ssldecrypt_assoc_t*) rec)->keyfile)); (((ssldecrypt_assoc_t*)rec)->keyfile) = new_buf; } static void sslkeylist_uats_keyfile_tostr_cb(void * rec, char** out_ptr, unsigned* out_len, const void* u1 __attribute__ ((unused)), const void* u2 __attribute__((unused))) { if (((ssldecrypt_assoc_t *)rec)->keyfile ) { *out_ptr = g_strdup_inline ((((ssldecrypt_assoc_t *)rec)->keyfile)); *out_len = (unsigned)strlen((((ssldecrypt_assoc_t *)rec)->keyfile)); } else { *out_ptr = g_strdup_inline ("" ); *out_len = 0; } } | |||
| 2796 | UAT_CSTRING_CB_DEF(sslkeylist_uats,password,ssldecrypt_assoc_t)static void sslkeylist_uats_password_set_cb(void* rec, const char * buf, unsigned len, const void* u1 __attribute__((unused)), const void* u2 __attribute__((unused))) { char* new_buf = g_strndup (buf,len); (__builtin_object_size (((((ssldecrypt_assoc_t*)rec )->password)), 0) != ((size_t) - 1)) ? g_free_sized ((((ssldecrypt_assoc_t *)rec)->password), __builtin_object_size (((((ssldecrypt_assoc_t *)rec)->password)), 0)) : (g_free) ((((ssldecrypt_assoc_t* )rec)->password)); (((ssldecrypt_assoc_t*)rec)->password ) = new_buf; } static void sslkeylist_uats_password_tostr_cb( void* rec, char** out_ptr, unsigned* out_len, const void* u1 __attribute__ ((unused)), const void* u2 __attribute__((unused))) { if (((ssldecrypt_assoc_t *)rec)->password ) { *out_ptr = g_strdup_inline ((((ssldecrypt_assoc_t *)rec)->password)); *out_len = (unsigned)strlen((((ssldecrypt_assoc_t *)rec)->password)); } else { *out_ptr = g_strdup_inline ("" ); *out_len = 0; } } | |||
| 2797 | ||||
| 2798 | static bool_Bool | |||
| 2799 | dtlsdecrypt_uat_fld_protocol_chk_cb(void* r _U___attribute__((unused)), const char* p, unsigned len _U___attribute__((unused)), const void* u1 _U___attribute__((unused)), const void* u2 _U___attribute__((unused)), char** err) | |||
| 2800 | { | |||
| 2801 | if (!p || strlen(p) == 0u) { | |||
| 2802 | // This should be removed in favor of Decode As. Make it optional. | |||
| 2803 | *err = NULL((void*)0); | |||
| 2804 | return true1; | |||
| 2805 | } | |||
| 2806 | ||||
| 2807 | if (!ssl_find_appdata_dissector(p)) { | |||
| 2808 | if (find_dissector(p)) { | |||
| 2809 | // ssl_find_appdata_dissector accepts any valid dissector name so | |||
| 2810 | // this path cannot happen | |||
| 2811 | *err = ws_strdup_printf("While '%s' is a valid dissector filter name, that dissector is not configured"wmem_strdup_printf(((void*)0), "While '%s' is a valid dissector filter name, that dissector is not configured" " to support DTLS decryption.\n\n" "If you need to decrypt '%s' over DTLS, please contact the Wireshark development team." , p, p) | |||
| 2812 | " to support DTLS decryption.\n\n"wmem_strdup_printf(((void*)0), "While '%s' is a valid dissector filter name, that dissector is not configured" " to support DTLS decryption.\n\n" "If you need to decrypt '%s' over DTLS, please contact the Wireshark development team." , p, p) | |||
| 2813 | "If you need to decrypt '%s' over DTLS, please contact the Wireshark development team.", p, p)wmem_strdup_printf(((void*)0), "While '%s' is a valid dissector filter name, that dissector is not configured" " to support DTLS decryption.\n\n" "If you need to decrypt '%s' over DTLS, please contact the Wireshark development team." , p, p); | |||
| 2814 | } else { | |||
| 2815 | // The GUI validates dissector names now so this path shouldn't | |||
| 2816 | // occur either. (Perhaps if the UAT is hand-edited it might?) | |||
| 2817 | char* ssl_str = ssl_association_info("dtls.port", "UDP"); | |||
| 2818 | *err = ws_strdup_printf("Could not find dissector for: '%s'\nCommonly used DTLS dissectors include:\n%s", p, ssl_str)wmem_strdup_printf(((void*)0), "Could not find dissector for: '%s'\nCommonly used DTLS dissectors include:\n%s" , p, ssl_str); | |||
| 2819 | g_free(ssl_str)(__builtin_object_size ((ssl_str), 0) != ((size_t) - 1)) ? g_free_sized (ssl_str, __builtin_object_size ((ssl_str), 0)) : (g_free) ( ssl_str); | |||
| 2820 | } | |||
| 2821 | return false0; | |||
| 2822 | } | |||
| 2823 | ||||
| 2824 | *err = NULL((void*)0); | |||
| 2825 | return true1; | |||
| 2826 | } | |||
| 2827 | #endif | |||
| 2828 | ||||
| 2829 | static void | |||
| 2830 | dtls_src_prompt(packet_info *pinfo, char *result) | |||
| 2831 | { | |||
| 2832 | SslPacketInfo* pi; | |||
| 2833 | uint32_t srcport = PINFO_SRCPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port1 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->srcport); | |||
| 2834 | ||||
| 2835 | pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_dtls, pinfo->curr_layer_num); | |||
| 2836 | if (pi != NULL((void*)0)) | |||
| 2837 | srcport = pi->srcport; | |||
| 2838 | ||||
| 2839 | snprintf(result, MAX_DECODE_AS_PROMPT_LEN200, "source (%u%s)", srcport, UTF8_RIGHTWARDS_ARROW"\u2192"); | |||
| 2840 | } | |||
| 2841 | ||||
| 2842 | static void * | |||
| 2843 | dtls_src_value(packet_info *pinfo) | |||
| 2844 | { | |||
| 2845 | SslPacketInfo* pi; | |||
| 2846 | ||||
| 2847 | pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_dtls, pinfo->curr_layer_num); | |||
| 2848 | if (pi == NULL((void*)0)) | |||
| 2849 | return GUINT_TO_POINTER(PINFO_SRCPORT(pinfo))((gpointer) (gulong) (((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port1((pinfo)->conv_addr_port_endpoints ) : (pinfo)->srcport))); | |||
| 2850 | ||||
| 2851 | return GUINT_TO_POINTER(pi->srcport)((gpointer) (gulong) (pi->srcport)); | |||
| 2852 | } | |||
| 2853 | ||||
| 2854 | static void | |||
| 2855 | dtls_dst_prompt(packet_info *pinfo, char *result) | |||
| 2856 | { | |||
| 2857 | SslPacketInfo* pi; | |||
| 2858 | uint32_t destport = PINFO_DESTPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port2 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->destport ); | |||
| 2859 | ||||
| 2860 | pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_dtls, pinfo->curr_layer_num); | |||
| 2861 | if (pi != NULL((void*)0)) | |||
| 2862 | destport = pi->destport; | |||
| 2863 | ||||
| 2864 | snprintf(result, MAX_DECODE_AS_PROMPT_LEN200, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW"\u2192", destport); | |||
| 2865 | } | |||
| 2866 | ||||
| 2867 | static void * | |||
| 2868 | dtls_dst_value(packet_info *pinfo) | |||
| 2869 | { | |||
| 2870 | SslPacketInfo* pi; | |||
| 2871 | ||||
| 2872 | pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_dtls, pinfo->curr_layer_num); | |||
| 2873 | if (pi == NULL((void*)0)) | |||
| 2874 | return GUINT_TO_POINTER(PINFO_DESTPORT(pinfo))((gpointer) (gulong) (((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port2((pinfo)->conv_addr_port_endpoints ) : (pinfo)->destport))); | |||
| 2875 | ||||
| 2876 | return GUINT_TO_POINTER(pi->destport)((gpointer) (gulong) (pi->destport)); | |||
| 2877 | } | |||
| 2878 | ||||
| 2879 | static void | |||
| 2880 | dtls_both_prompt(packet_info *pinfo, char *result) | |||
| 2881 | { | |||
| 2882 | SslPacketInfo* pi; | |||
| 2883 | uint32_t srcport = PINFO_SRCPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port1 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->srcport), | |||
| 2884 | destport = PINFO_DESTPORT(pinfo)((pinfo)->use_conv_addr_port_endpoints ? conversation_addr_port_endpoints_port2 ((pinfo)->conv_addr_port_endpoints) : (pinfo)->destport ); | |||
| 2885 | ||||
| 2886 | pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_dtls, pinfo->curr_layer_num); | |||
| 2887 | if (pi != NULL((void*)0)) | |||
| 2888 | { | |||
| 2889 | srcport = pi->srcport; | |||
| 2890 | destport = pi->destport; | |||
| 2891 | } | |||
| 2892 | ||||
| 2893 | snprintf(result, MAX_DECODE_AS_PROMPT_LEN200, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW"\u2194", destport); | |||
| 2894 | } | |||
| 2895 | ||||
| 2896 | void proto_reg_handoff_dtls(void); | |||
| 2897 | ||||
| 2898 | /********************************************************************* | |||
| 2899 | * | |||
| 2900 | * Standard Wireshark Protocol Registration and housekeeping | |||
| 2901 | * | |||
| 2902 | *********************************************************************/ | |||
| 2903 | void | |||
| 2904 | proto_register_dtls(void) | |||
| 2905 | { | |||
| 2906 | ||||
| 2907 | /* Setup list of header fields See Section 1.6.1 for details*/ | |||
| 2908 | static hf_register_info hf[] = { | |||
| 2909 | { &hf_dtls_stream, | |||
| 2910 | { "Stream index", "dtls.stream", | |||
| 2911 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, | |||
| 2912 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2913 | }, | |||
| 2914 | { &hf_dtls_record, | |||
| 2915 | { "Record Layer", "dtls.record", | |||
| 2916 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, | |||
| 2917 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2918 | }, | |||
| 2919 | { &hf_dtls_record_content_type, | |||
| 2920 | { "Content Type", "dtls.record.content_type", | |||
| 2921 | FT_UINT8, BASE_DEC, VALS(ssl_31_content_type)((0 ? (const struct _value_string*)0 : ((ssl_31_content_type) ))), 0x0, | |||
| 2922 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} | |||
| 2923 | }, | |||
| 2924 | { &hf_dtls_record_special_type, | |||
| 2925 | { "Special Type", "dtls.record.special_type", | |||
| 2926 | FT_UINT8, BASE_DEC, VALS(ssl_31_content_type)((0 ? (const struct _value_string*)0 : ((ssl_31_content_type) ))), 0x0, | |||
| 2927 | "Always set to value 25, actual content type is known after decryption", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} | |||
| 2928 | }, | |||
| 2929 | { &hf_dtls_record_version, | |||
| 2930 | { "Version", "dtls.record.version", | |||
| 2931 | FT_UINT16, BASE_HEX, VALS(ssl_versions)((0 ? (const struct _value_string*)0 : ((ssl_versions)))), 0x0, | |||
| 2932 | "Record layer version", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2933 | }, | |||
| 2934 | { &hf_dtls_record_epoch, | |||
| 2935 | { "Epoch", "dtls.record.epoch", | |||
| 2936 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, | |||
| 2937 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2938 | }, | |||
| 2939 | { &hf_dtls_record_epoch64, | |||
| 2940 | { "Epoch", "dtls.record.epoch", | |||
| 2941 | FT_UINT64, BASE_DEC, NULL((void*)0), 0x0, | |||
| 2942 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2943 | }, | |||
| 2944 | { &hf_dtls_record_sequence_number, | |||
| 2945 | { "Sequence Number", "dtls.record.sequence_number", | |||
| 2946 | FT_UINT64, BASE_DEC, NULL((void*)0), 0x0, | |||
| 2947 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2948 | }, | |||
| 2949 | { &hf_dtls_record_sequence_suffix, | |||
| 2950 | { "Sequence Number suffix", "dtls.record.sequence_suffix", | |||
| 2951 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, | |||
| 2952 | "Lowest-order bits of the sequence number", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2953 | }, | |||
| 2954 | { &hf_dtls_record_sequence_suffix_dec, | |||
| 2955 | { "Sequence Number suffix (decrypted)", "dtls.record.sequence_suffix_dec", | |||
| 2956 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, | |||
| 2957 | "Lowest-order bits of the sequence number (decrypted)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2958 | }, | |||
| 2959 | { &hf_dtls_record_connection_id, | |||
| 2960 | { "Connection ID", "dtls.record.connection_id", | |||
| 2961 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, | |||
| 2962 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2963 | }, | |||
| 2964 | { &hf_dtls_record_length, | |||
| 2965 | { "Length", "dtls.record.length", | |||
| 2966 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, | |||
| 2967 | "Length of DTLS record data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2968 | }, | |||
| 2969 | { &hf_dtls_record_appdata, | |||
| 2970 | { "Encrypted Application Data", "dtls.app_data", | |||
| 2971 | FT_BYTES, BASE_NONE|BASE_NO_DISPLAY_VALUE0x00002000, NULL((void*)0), 0x0, | |||
| 2972 | "Payload is encrypted application data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2973 | }, | |||
| 2974 | { &hf_dtls_record_appdata_proto, | |||
| 2975 | { "Application Data Protocol", "dtls.app_data_proto", | |||
| 2976 | FT_STRING, BASE_NONE, NULL((void*)0), 0x0, | |||
| 2977 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2978 | }, | |||
| 2979 | { &hf_dtls_record_encrypted_content, | |||
| 2980 | { "Encrypted Record Content", "dtls.enc_content", | |||
| 2981 | FT_BYTES, BASE_NONE|BASE_NO_DISPLAY_VALUE0x00002000, NULL((void*)0), 0x0, | |||
| 2982 | "Encrypted record data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2983 | }, | |||
| 2984 | { &hf_dtls_alert_message, | |||
| 2985 | { "Alert Message", "dtls.alert_message", | |||
| 2986 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, | |||
| 2987 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2988 | }, | |||
| 2989 | { &hf_dtls_alert_message_level, | |||
| 2990 | { "Level", "dtls.alert_message.level", | |||
| 2991 | FT_UINT8, BASE_DEC, VALS(ssl_31_alert_level)((0 ? (const struct _value_string*)0 : ((ssl_31_alert_level)) )), 0x0, | |||
| 2992 | "Alert message level", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2993 | }, | |||
| 2994 | { &hf_dtls_alert_message_description, | |||
| 2995 | { "Description", "dtls.alert_message.desc", | |||
| 2996 | FT_UINT8, BASE_DEC, VALS(ssl_31_alert_description)((0 ? (const struct _value_string*)0 : ((ssl_31_alert_description )))), 0x0, | |||
| 2997 | "Alert message description", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 2998 | }, | |||
| 2999 | { &hf_dtls_handshake_protocol, | |||
| 3000 | { "Handshake Protocol", "dtls.handshake", | |||
| 3001 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, | |||
| 3002 | "Handshake protocol message", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} | |||
| 3003 | }, | |||
| 3004 | { &hf_dtls_handshake_type, | |||
| 3005 | { "Handshake Type", "dtls.handshake.type", | |||
| 3006 | FT_UINT8, BASE_DEC, VALS(ssl_31_handshake_type)((0 ? (const struct _value_string*)0 : ((ssl_31_handshake_type )))), 0x0, | |||
| 3007 | "Type of handshake message", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} | |||
| 3008 | }, | |||
| 3009 | { &hf_dtls_handshake_length, | |||
| 3010 | { "Length", "dtls.handshake.length", | |||
| 3011 | FT_UINT24, BASE_DEC, NULL((void*)0), 0x0, | |||
| 3012 | "Length of handshake message", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3013 | }, | |||
| 3014 | { &hf_dtls_handshake_message_seq, | |||
| 3015 | { "Message Sequence", "dtls.handshake.message_seq", | |||
| 3016 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, | |||
| 3017 | "Message sequence of handshake message", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3018 | }, | |||
| 3019 | { &hf_dtls_handshake_fragment_offset, | |||
| 3020 | { "Fragment Offset", "dtls.handshake.fragment_offset", | |||
| 3021 | FT_UINT24, BASE_DEC, NULL((void*)0), 0x0, | |||
| 3022 | "Fragment offset of handshake message", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3023 | }, | |||
| 3024 | { &hf_dtls_handshake_fragment_length, | |||
| 3025 | { "Fragment Length", "dtls.handshake.fragment_length", | |||
| 3026 | FT_UINT24, BASE_DEC, NULL((void*)0), 0x0, | |||
| 3027 | "Fragment length of handshake message", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3028 | }, | |||
| 3029 | { &dtls_hfs.hf_dtls_handshake_cookie_len, | |||
| 3030 | { "Cookie Length", "dtls.handshake.cookie_length", | |||
| 3031 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, | |||
| 3032 | "Length of the cookie field", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3033 | }, | |||
| 3034 | { &dtls_hfs.hf_dtls_handshake_cookie, | |||
| 3035 | { "Cookie", "dtls.handshake.cookie", | |||
| 3036 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, | |||
| 3037 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3038 | }, | |||
| 3039 | { &hf_dtls_heartbeat_message, | |||
| 3040 | { "Heartbeat Message", "dtls.heartbeat_message", | |||
| 3041 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, | |||
| 3042 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3043 | }, | |||
| 3044 | { &hf_dtls_heartbeat_message_type, | |||
| 3045 | { "Type", "dtls.heartbeat_message.type", | |||
| 3046 | FT_UINT8, BASE_DEC, VALS(tls_heartbeat_type)((0 ? (const struct _value_string*)0 : ((tls_heartbeat_type)) )), 0x0, | |||
| 3047 | "Heartbeat message type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3048 | }, | |||
| 3049 | { &hf_dtls_heartbeat_message_payload_length, | |||
| 3050 | { "Payload Length", "dtls.heartbeat_message.payload_length", | |||
| 3051 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3052 | }, | |||
| 3053 | { &hf_dtls_heartbeat_message_payload, | |||
| 3054 | { "Payload Length", "dtls.heartbeat_message.payload", | |||
| 3055 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3056 | }, | |||
| 3057 | { &hf_dtls_heartbeat_message_padding, | |||
| 3058 | { "Payload Length", "dtls.heartbeat_message.padding", | |||
| 3059 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3060 | }, | |||
| 3061 | { &hf_dtls_ack_message, | |||
| 3062 | { "Acknowledgement Message", "dtls.ack_message", | |||
| 3063 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, | |||
| 3064 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3065 | }, | |||
| 3066 | { &hf_dtls_ack_record_numbers_length, | |||
| 3067 | { "Record Numbers Length", "dtls.ack.record_numbers_length", | |||
| 3068 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, | |||
| 3069 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3070 | }, | |||
| 3071 | { &hf_dtls_fragments, | |||
| 3072 | { "Message fragments", "dtls.fragments", | |||
| 3073 | FT_NONE, BASE_NONE, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3074 | }, | |||
| 3075 | { &hf_dtls_fragment, | |||
| 3076 | { "Message fragment", "dtls.fragment", | |||
| 3077 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3078 | }, | |||
| 3079 | { &hf_dtls_ack_record_numbers, | |||
| 3080 | { "Record Numbers", "dtls.ack.record_numbers", | |||
| 3081 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, | |||
| 3082 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3083 | }, | |||
| 3084 | { &hf_dtls_fragment_overlap, | |||
| 3085 | { "Message fragment overlap", "dtls.fragment.overlap", | |||
| 3086 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3087 | }, | |||
| 3088 | { &hf_dtls_fragment_overlap_conflicts, | |||
| 3089 | { "Message fragment overlapping with conflicting data", | |||
| 3090 | "dtls.fragment.overlap.conflicts", | |||
| 3091 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3092 | }, | |||
| 3093 | { &hf_dtls_fragment_multiple_tails, | |||
| 3094 | { "Message has multiple tail fragments", | |||
| 3095 | "dtls.fragment.multiple_tails", | |||
| 3096 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3097 | }, | |||
| 3098 | { &hf_dtls_fragment_too_long_fragment, | |||
| 3099 | { "Message fragment too long", "dtls.fragment.too_long_fragment", | |||
| 3100 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3101 | }, | |||
| 3102 | { &hf_dtls_fragment_error, | |||
| 3103 | { "Message defragmentation error", "dtls.fragment.error", | |||
| 3104 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3105 | }, | |||
| 3106 | { &hf_dtls_fragment_count, | |||
| 3107 | { "Message fragment count", "dtls.fragment.count", | |||
| 3108 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3109 | }, | |||
| 3110 | { &hf_dtls_reassembled_in, | |||
| 3111 | { "Reassembled in", "dtls.reassembled.in", | |||
| 3112 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3113 | }, | |||
| 3114 | { &hf_dtls_reassembled_length, | |||
| 3115 | { "Reassembled DTLS length", "dtls.reassembled.length", | |||
| 3116 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3117 | }, | |||
| 3118 | { &hf_dtls_hs_ext_use_srtp_protection_profiles_length, | |||
| 3119 | { "SRTP Protection Profiles Length", "dtls.use_srtp.protection_profiles_length", | |||
| 3120 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3121 | }, | |||
| 3122 | { &hf_dtls_hs_ext_use_srtp_protection_profile, | |||
| 3123 | { "SRTP Protection Profile", "dtls.use_srtp.protection_profile", | |||
| 3124 | FT_UINT16, BASE_HEX, VALS(srtp_protection_profile_vals)((0 ? (const struct _value_string*)0 : ((srtp_protection_profile_vals )))), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3125 | }, | |||
| 3126 | { &hf_dtls_hs_ext_use_srtp_mki_length, | |||
| 3127 | { "MKI Length", "dtls.use_srtp.mki_length", | |||
| 3128 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3129 | }, | |||
| 3130 | { &hf_dtls_hs_ext_use_srtp_mki, | |||
| 3131 | { "MKI", "dtls.use_srtp.mki", | |||
| 3132 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3133 | }, | |||
| 3134 | { &hf_dtls_uni_hdr, | |||
| 3135 | { "Unified header bitmask", "dtls.unified_header.bitmask", | |||
| 3136 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x00, "DTLS 1.3 unified header bitmask", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3137 | }, | |||
| 3138 | { &hf_dtls_uni_hdr_fixed, | |||
| 3139 | { "Fixed bits", "dtls.unified_header.fixed", | |||
| 3140 | FT_UINT8, BASE_HEX, NULL((void*)0), DTLS13_FIXED_MASK0xE0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3141 | }, | |||
| 3142 | { &hf_dtls_uni_hdr_cid, | |||
| 3143 | { "CID field", "dtls.unified_header.cid_present", | |||
| 3144 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), DTLS13_C_BIT_MASK0x10, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3145 | }, | |||
| 3146 | { &hf_dtls_uni_hdr_seq, | |||
| 3147 | { "Sequence number size", "dtls.unified_header.seq_size", | |||
| 3148 | FT_BOOLEAN, 8, TFS(&dtls_uni_hdr_seq_tfs)((0 ? (const struct true_false_string*)0 : ((&dtls_uni_hdr_seq_tfs )))), DTLS13_S_BIT_MASK0x08, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3149 | }, | |||
| 3150 | { &hf_dtls_uni_hdr_len, | |||
| 3151 | { "Length field", "dtls.unified_header.length", | |||
| 3152 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), DTLS13_L_BIT_MASK0x04, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3153 | }, | |||
| 3154 | { &hf_dtls_uni_hdr_epoch, | |||
| 3155 | { "Epoch lowest-order bits", "dtls.unified_header.epoch_bits", | |||
| 3156 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x03, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } | |||
| 3157 | }, | |||
| 3158 | ||||
| 3159 | SSL_COMMON_HF_LIST(dissect_dtls_hf, "dtls"){ & dissect_dtls_hf .hf.change_cipher_spec, { "Change Cipher Spec Message" , "dtls" ".change_cipher_spec", FT_NONE, BASE_NONE, ((void*)0 ), 0x0, "Signals a change in cipher specifications", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_exts_len , { "Extensions Length", "dtls" ".handshake.extensions_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of hello extensions" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext, { "Extension", "dtls" ".handshake.extension", FT_NONE , BASE_NONE, ((void*)0), 0x0, "Hello extension", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_type , { "Type", "dtls" ".handshake.extension.type", FT_UINT16, BASE_DEC , ((0 ? (const struct _value_string*)0 : ((tls_hello_extension_types )))), 0x0, "Hello extension type", -1, 0, HF_REF_TYPE_NONE, - 1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_len, { "Length" , "dtls" ".handshake.extension.len", FT_UINT16, BASE_DEC, ((void *)0), 0x0, "Length of a hello extension", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_data , { "Data", "dtls" ".handshake.extension.data", FT_BYTES, BASE_NONE , ((void*)0), 0x0, "Hello Extension data", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_ech_outer_ext_len , { "Outer Extensions List Length", "dtls" ".handshake.extensions_ech_outer_extensions_length" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_ech_outer_ext , { "Outer Extensions List", "dtls" ".handshake.extensions_ech_outer_extensions" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "List of extensions derived from Outer Client Hello" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ech_confirm, { "ECH Confirmation Bytes", "dtls" ".handshake.ech_confirm" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ech_confirm_compute , { "Computed ECH Confirmation Bytes", "dtls" ".handshake.ech_confirm_compute" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_supported_groups_len , { "Supported Groups List Length", "dtls" ".handshake.extensions_supported_groups_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_supported_groups , { "Supported Groups List", "dtls" ".handshake.extensions_supported_groups" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "List of supported groups (formerly Supported Elliptic Curves)" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_supported_group, { "Supported Group", "dtls" ".handshake.extensions_supported_group" , FT_UINT16, BASE_HEX, ((0 ? (const struct _value_string*)0 : ((ssl_extension_curves)))), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_ec_point_formats_len , { "EC point formats Length", "dtls" ".handshake.extensions_ec_point_formats_length" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of elliptic curves point formats field" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_ec_point_formats, { "EC point formats", "dtls" ".handshake.extensions_ec_point_formats" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "List of elliptic curves point format" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_ec_point_format, { "EC point format", "dtls" ".handshake.extensions_ec_point_format" , FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ( (ssl_extension_ec_point_formats)))), 0x0, "Elliptic curves point format" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_srp_len, { "SRP username length", "dtls" ".handshake.extensions_srp_len" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of Secure Remote Password username field" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_srp_username, { "SRP username", "dtls" ".handshake.extensions_srp_username" , FT_STRING, BASE_NONE, ((void*)0), 0x0, "Secure Remote Password username" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_alpn_len, { "ALPN Extension Length", "dtls" ".handshake.extensions_alpn_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of the ALPN Extension" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_alpn_list, { "ALPN Protocol", "dtls" ".handshake.extensions_alpn_list" , FT_NONE, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_alpn_str_len , { "ALPN string length", "dtls" ".handshake.extensions_alpn_str_len" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of ALPN string" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_alpn_str, { "ALPN Next Protocol", "dtls" ".handshake.extensions_alpn_str" , FT_STRING, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_npn_str_len , { "Protocol string length", "dtls" ".handshake.extensions_npn_str_len" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of next protocol string" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_npn_str, { "Next Protocol", "dtls" ".handshake.extensions_npn" , FT_STRING, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_reneg_info_len , { "Renegotiation info extension length", "dtls" ".handshake.extensions_reneg_info_len" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_reneg_info , { "Renegotiation info", "dtls" ".handshake.extensions_reneg_info" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_key_share_client_length , { "Client Key Share Length", "dtls" ".handshake.extensions_key_share_client_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_key_share_group , { "Group", "dtls" ".handshake.extensions_key_share_group", FT_UINT16 , BASE_DEC, ((0 ? (const struct _value_string*)0 : ((ssl_extension_curves )))), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*) 0) } }, { & dissect_dtls_hf .hf.hs_ext_key_share_key_exchange_length , { "Key Exchange Length", "dtls" ".handshake.extensions_key_share_key_exchange_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_key_share_key_exchange , { "Key Exchange", "dtls" ".handshake.extensions_key_share_key_exchange" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_key_share_selected_group , { "Selected Group", "dtls" ".handshake.extensions_key_share_selected_group" , FT_UINT16, BASE_DEC, ((0 ? (const struct _value_string*)0 : ((ssl_extension_curves)))), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_identities_length , { "Identities Length", "dtls" ".handshake.extensions.psk.identities.length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_identity_identity_length , { "Identity Length", "dtls" ".handshake.extensions.psk.identity.identity_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_identity_identity , { "Identity", "dtls" ".handshake.extensions.psk.identity.identity" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_identity_obfuscated_ticket_age , { "Obfuscated Ticket Age", "dtls" ".handshake.extensions.psk.identity.obfuscated_ticket_age" , FT_UINT32, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_binders_length , { "PSK Binders length", "dtls" ".handshake.extensions.psk.binders_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_binders , { "PSK Binders", "dtls" ".handshake.extensions.psk.binders" , FT_NONE, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_binder , { "PSK Binder", "dtls" ".handshake.extensions.psk.binder", FT_NONE , BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_binder_binder_length , { "Binder Length", "dtls" ".handshake.extensions.psk.binder.binder_length" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_binder_binder , { "Binder", "dtls" ".handshake.extensions.psk.binder.binder" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_identity_selected , { "Selected Identity", "dtls" ".handshake.extensions.psk.identity.selected" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_session_ticket , { "Session Ticket", "dtls" ".handshake.extensions.session_ticket" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_supported_versions_len , { "Supported Versions length", "dtls" ".handshake.extensions.supported_versions_len" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_supported_version , { "Supported Version", "dtls" ".handshake.extensions.supported_version" , FT_UINT16, BASE_HEX, ((0 ? (const struct _value_string*)0 : ((ssl_versions)))), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cookie_len , { "Cookie length", "dtls" ".handshake.extensions.cookie_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cookie , { "Cookie", "dtls" ".handshake.extensions.cookie", FT_BYTES , BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_server_name_list_len , { "Server Name list length", "dtls" ".handshake.extensions_server_name_list_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of server name list" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_server_name_len, { "Server Name length", "dtls" ".handshake.extensions_server_name_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of server name string" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_server_name_type, { "Server Name Type", "dtls" ".handshake.extensions_server_name_type" , FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ( (tls_hello_ext_server_name_type_vs)))), 0x0, ((void*)0), -1, 0 , HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_server_name, { "Server Name", "dtls" ".handshake.extensions_server_name" , FT_STRING, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_max_fragment_length , { "Maximum Fragment Length", "dtls" ".handshake.max_fragment_length" , FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ( (tls_hello_ext_max_fragment_length)))), 0x00, "Maximum fragment length that an endpoint is willing to receive" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_padding_data, { "Padding Data", "dtls" ".handshake.extensions_padding_data" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Must be zero", -1, 0 , HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_url_type, { "Certificate Chain Type", "dtls" ".handshake.cert_url_type", FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ((tls_cert_chain_type)))), 0x0, "Certificate Chain Type for Client Certificate URL" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_url_url_hash_list_len, { "URL and Hash list Length" , "dtls" ".handshake.cert_url.url_hash_len", FT_UINT16, BASE_DEC , ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_url_item , { "URL and Hash", "dtls" ".handshake.cert_url.url_hash", FT_NONE , BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_url_url_len , { "URL Length", "dtls" ".handshake.cert_url.url_len", FT_UINT16 , BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_type , { "Certificate Type", "dtls" ".handshake.cert_type.type", FT_UINT8 , BASE_HEX, ((0 ? (const struct _value_string*)0 : ((tls_certificate_type )))), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0 ) } }, { & dissect_dtls_hf .hf.hs_ext_cert_types, { "Certificate Type List" , "dtls" ".handshake.cert_type.types", FT_NONE, BASE_NONE, (( void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_types_len, { "Certificate Type List Length", "dtls" ".handshake.cert_type.types_len" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_url_url , { "URL", "dtls" ".handshake.cert_url.url", FT_STRING, BASE_NONE , ((void*)0), 0x0, "URL used to fetch the certificate(s)", -1 , 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_url_padding, { "Padding", "dtls" ".handshake.cert_url.padding" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "Padding that MUST be 0x01 for backwards compatibility" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_url_sha1, { "SHA1 Hash", "dtls" ".handshake.cert_url.sha1" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "SHA1 Hash of the certificate" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_status_type, { "Certificate Status Type", "dtls" ".handshake.extensions_status_request_type", FT_UINT8, BASE_DEC , ((0 ? (const struct _value_string*)0 : ((tls_cert_status_type )))), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0 ) } }, { & dissect_dtls_hf .hf.hs_ext_cert_status_request_len , { "Certificate Status Length", "dtls" ".handshake.extensions_status_request_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_status_responder_id_list_len , { "Responder ID list Length", "dtls" ".handshake.extensions_status_request_responder_ids_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_status_request_extensions_len , { "Request Extensions Length", "dtls" ".handshake.extensions_status_request_exts_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_cert_status_request_list_len , { "Certificate Status List Length", "dtls" ".handshake.extensions_status_request_list_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "CertificateStatusRequestItemV2 list length" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ocsp_response_list_len, { "OCSP Response List Length" , "dtls" ".handshake.ocsp_response_list_len", FT_UINT24, BASE_DEC , ((void*)0), 0x0, "OCSPResponseList length", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ocsp_response_len , { "OCSP Response Length", "dtls" ".handshake.ocsp_response_len" , FT_UINT24, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_sig_hash_alg_len , { "Signature Hash Algorithms Length", "dtls" ".handshake.sig_hash_alg_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of Signature Hash Algorithms" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_sig_hash_algs, { "Signature Algorithms", "dtls" ".handshake.sig_hash_algs" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "List of supported Signature Algorithms" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_sig_hash_alg, { "Signature Algorithm", "dtls" ".handshake.sig_hash_alg" , FT_UINT16, BASE_HEX, ((0 ? (const struct _value_string*)0 : ((tls13_signature_algorithm)))), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_sig_hash_hash , { "Signature Hash Algorithm Hash", "dtls" ".handshake.sig_hash_hash" , FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ( (tls_hash_algorithm)))), 0x0, "Hash algorithm (TLS 1.2)", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_sig_hash_sig, { "Signature Hash Algorithm Signature", "dtls" ".handshake.sig_hash_sig", FT_UINT8, BASE_DEC, ((0 ? ( const struct _value_string*)0 : ((tls_signature_algorithm)))) , 0x0, "Signature algorithm (TLS 1.2)", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_epms_len , { "Encrypted PreMaster length", "dtls" ".handshake.epms_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of encrypted PreMaster secret" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_epms, { "Encrypted PreMaster", "dtls" ".handshake.epms" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Encrypted PreMaster secret" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_modulus_len, { "Modulus Length", "dtls" ".handshake.modulus_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of RSA-EXPORT modulus" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_exponent_len, { "Exponent Length", "dtls" ".handshake.exponent_len", FT_UINT16, BASE_DEC, ((void*)0), 0x0 , "Length of RSA-EXPORT exponent", -1, 0, HF_REF_TYPE_NONE, - 1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_sig_len , { "Signature Length", "dtls" ".handshake.sig_len", FT_UINT16 , BASE_DEC, ((void*)0), 0x0, "Length of Signature", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_p_len , { "p Length", "dtls" ".handshake.p_len", FT_UINT16, BASE_DEC , ((void*)0), 0x0, "Length of p", -1, 0, HF_REF_TYPE_NONE, -1 , ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_g_len , { "g Length", "dtls" ".handshake.g_len", FT_UINT16, BASE_DEC , ((void*)0), 0x0, "Length of g", -1, 0, HF_REF_TYPE_NONE, -1 , ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_ys_len , { "Pubkey Length", "dtls" ".handshake.ys_len", FT_UINT16, BASE_DEC , ((void*)0), 0x0, "Length of server's Diffie-Hellman public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_yc_len, { "Pubkey Length", "dtls" ".handshake.yc_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of client's Diffie-Hellman public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_point_len, { "Pubkey Length", "dtls" ".handshake.client_point_len" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of client's EC Diffie-Hellman public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_point_len, { "Pubkey Length", "dtls" ".handshake.server_point_len" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of server's EC Diffie-Hellman public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_p, { "p", "dtls" ".handshake.p", FT_BYTES , BASE_NONE, ((void*)0), 0x0, "Diffie-Hellman p", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_g , { "g", "dtls" ".handshake.g", FT_BYTES, BASE_NONE, ((void*) 0), 0x0, "Diffie-Hellman g", -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_curve_type , { "Curve Type", "dtls" ".handshake.server_curve_type", FT_UINT8 , BASE_HEX, ((0 ? (const struct _value_string*)0 : ((ssl_curve_types )))), 0x0, "Server curve_type", -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_named_curve , { "Named Curve", "dtls" ".handshake.server_named_curve", FT_UINT16 , BASE_HEX, ((0 ? (const struct _value_string*)0 : ((ssl_extension_curves )))), 0x0, "Server named_curve", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_ys , { "Pubkey", "dtls" ".handshake.ys", FT_BYTES, BASE_NONE, (( void*)0), 0x0, "Diffie-Hellman server pubkey", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_yc , { "Pubkey", "dtls" ".handshake.yc", FT_BYTES, BASE_NONE, (( void*)0), 0x0, "Diffie-Hellman client pubkey", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_point , { "Pubkey", "dtls" ".handshake.server_point", FT_BYTES, BASE_NONE , ((void*)0), 0x0, "EC Diffie-Hellman server pubkey", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_point , { "Pubkey", "dtls" ".handshake.client_point", FT_BYTES, BASE_NONE , ((void*)0), 0x0, "EC Diffie-Hellman client pubkey", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_xs_len , { "Pubkey Length", "dtls" ".handshake.xs_len", FT_UINT8, BASE_DEC , ((void*)0), 0x0, "Length of EC J-PAKE server public key", - 1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_xc_len, { "Pubkey Length", "dtls" ".handshake.xc_len" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of EC J-PAKE client public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_xs, { "Pubkey", "dtls" ".handshake.xs", FT_BYTES , BASE_NONE, ((void*)0), 0x0, "EC J-PAKE server public key", - 1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_xc, { "Pubkey", "dtls" ".handshake.xc", FT_BYTES , BASE_NONE, ((void*)0), 0x0, "EC J-PAKE client public key", - 1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_vs_len, { "Ephemeral Pubkey Length", "dtls" ".handshake.vs_len", FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of EC J-PAKE server ephemeral public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_vc_len, { "Ephemeral Pubkey Length", "dtls" ".handshake.vc_len", FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of EC J-PAKE client ephemeral public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_vs, { "Ephemeral Pubkey", "dtls" ".handshake.vs" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "EC J-PAKE server ephemeral public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_vc, { "Ephemeral Pubkey", "dtls" ".handshake.vc" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "EC J-PAKE client ephemeral public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_rs_len, { "Schnorr signature Length", "dtls" ".handshake.rs_len", FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of EC J-PAKE server Schnorr signature" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_rc_len, { "Schnorr signature Length", "dtls" ".handshake.rc_len", FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of EC J-PAKE client Schnorr signature" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_rs, { "Schnorr signature", "dtls" ".handshake.rs" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "EC J-PAKE server Schnorr signature" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_rc, { "Schnorr signature", "dtls" ".handshake.rc" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "EC J-PAKE client Schnorr signature" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_modulus, { "Modulus", "dtls" ".handshake.modulus" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "RSA-EXPORT modulus", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_exponent, { "Exponent", "dtls" ".handshake.exponent" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "RSA-EXPORT exponent" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_sig, { "Signature", "dtls" ".handshake.sig" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Diffie-Hellman server signature" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_hint_len, { "Hint Length", "dtls" ".handshake.hint_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of PSK Hint", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_keyex_hint, { "Hint", "dtls" ".handshake.hint" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "PSK Hint", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_identity_len , { "Identity Length", "dtls" ".handshake.identity_len", FT_UINT16 , BASE_DEC, ((void*)0), 0x0, "Length of PSK Identity", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_keyex_identity, { "Identity", "dtls" ".handshake.identity" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "PSK Identity", -1, 0 , HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_heartbeat_mode, { "Mode", "dtls" ".handshake.extension.heartbeat.mode" , FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ( (tls_heartbeat_mode)))), 0x0, "Heartbeat extension mode", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_certificates_len, { "Certificates Length", "dtls" ".handshake.certificates_length" , FT_UINT24, BASE_DEC, ((void*)0), 0x0, "Length of certificates field" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_certificates, { "Certificates", "dtls" ".handshake.certificates" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "List of certificates" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_certificate, { "Certificate", "dtls" ".handshake.certificate" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_certificate_len , { "Certificate Length", "dtls" ".handshake.certificate_length" , FT_UINT24, BASE_DEC, ((void*)0), 0x0, "Length of certificate" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cert_types_count, { "Certificate types count", "dtls" ".handshake.cert_types_count", FT_UINT8, BASE_DEC, ((void*)0 ), 0x0, "Count of certificate types", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cert_types , { "Certificate types", "dtls" ".handshake.cert_types", FT_NONE , BASE_NONE, ((void*)0), 0x0, "List of certificate types", -1 , 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cert_type, { "Certificate type", "dtls" ".handshake.cert_type" , FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ( (ssl_31_client_certificate_type)))), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_dnames_len , { "Distinguished Names Length", "dtls" ".handshake.dnames_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of list of CAs that server trusts" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_dnames, { "Distinguished Names", "dtls" ".handshake.dnames" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "List of CAs that server trusts" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_dname_len, { "Distinguished Name Length", "dtls" ".handshake.dname_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of distinguished name" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_dnames_truncated, { "Tree view truncated", "dtls" ".handshake.dnames_truncated" , FT_NONE, BASE_NONE, ((void*)0), 0x00, "Some Distinguished Names are not added to tree pane to limit resources" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_dname, { "Distinguished Name", "dtls" ".handshake.dname" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "Distinguished name of a CA that server trusts" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_random, { "Random", "dtls" ".handshake.random", FT_BYTES , BASE_NONE, ((void*)0), 0x0, "Random values used for deriving keys" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_random_time, { "GMT Unix Time", "dtls" ".handshake.random_time" , FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, ((void*)0), 0x0, "Unix time field of random structure" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_random_bytes, { "Random Bytes", "dtls" ".handshake.random_bytes" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Random values used for deriving keys" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_session_id, { "Session ID", "dtls" ".handshake.session_id" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Identifies the SSL session, allowing later resumption" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_session_id_len, { "Session ID Length", "dtls" ".handshake.session_id_length" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, "Length of Session ID field" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_version, { "Version", "dtls" ".handshake.version" , FT_UINT16, BASE_HEX, ((0 ? (const struct _value_string*)0 : ((ssl_versions)))), 0x0, "Maximum version supported by client [legacy_version if supported_versions ext is present]" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_server_version, { "Version", "dtls" ".handshake.version" , FT_UINT16, BASE_HEX, ((0 ? (const struct _value_string*)0 : ((ssl_versions)))), 0x0, "Version selected by server [legacy_version if supported_versions ext is present]" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cipher_suites_len, { "Cipher Suites Length", "dtls" ".handshake.cipher_suites_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of cipher suites field" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cipher_suites, { "Cipher Suites", "dtls" ".handshake.ciphersuites" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "List of cipher suites supported by client" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cipher_suite, { "Cipher Suite", "dtls" ".handshake.ciphersuite" , FT_UINT16, BASE_HEX|0x00000200, &ssl_31_ciphersuite_ext , 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } } , { & dissect_dtls_hf .hf.hs_comp_methods_len, { "Compression Methods Length" , "dtls" ".handshake.comp_methods_length", FT_UINT8, BASE_DEC , ((void*)0), 0x0, "Length of compression methods field", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_comp_methods, { "Compression Methods", "dtls" ".handshake.comp_methods" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "List of compression methods supported by client" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_comp_method, { "Compression Method", "dtls" ".handshake.comp_method" , FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ( (ssl_31_compression_method)))), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_session_ticket_lifetime_hint , { "Session Ticket Lifetime Hint", "dtls" ".handshake.session_ticket_lifetime_hint" , FT_UINT32, BASE_DEC|0x00001000, ((0 ? (const struct unit_name_string *)0 : ((&units_second_seconds)))), 0x0, "New Session Ticket Lifetime Hint" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_session_ticket_age_add, { "Session Ticket Age Add", "dtls" ".handshake.session_ticket_age_add", FT_UINT32, BASE_DEC, (( void*)0), 0x0, "Random 32-bit value to obscure age of ticket" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_session_ticket_nonce_len, { "Session Ticket Nonce Length" , "dtls" ".handshake.session_ticket_nonce_length", FT_UINT8, BASE_DEC , ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.hs_session_ticket_nonce , { "Session Ticket Nonce", "dtls" ".handshake.session_ticket_nonce" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "A unique per-ticket value" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_session_ticket_len, { "Session Ticket Length", "dtls" ".handshake.session_ticket_length", FT_UINT16, BASE_DEC, ((void *)0), 0x0, "New Session Ticket Length", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_session_ticket , { "Session Ticket", "dtls" ".handshake.session_ticket", FT_BYTES , BASE_NONE, ((void*)0), 0x0, "New Session Ticket", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_finished , { "Verify Data", "dtls" ".handshake.verify_data", FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Opaque verification data", -1, 0 , HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_cert_vrfy_sig_len, { "Signature length", "dtls" ".handshake.client_cert_vrfy.sig_len", FT_UINT16, BASE_DEC, ( (void*)0), 0x0, "Length of CertificateVerify's signature", -1 , 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_client_cert_vrfy_sig, { "Signature", "dtls" ".handshake.client_cert_vrfy.sig" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "CertificateVerify's signature" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ja3_full, { "JA3 Fullstring", "dtls" ".handshake.ja3_full" , FT_STRING, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ja3_hash , { "JA3", "dtls" ".handshake.ja3", FT_STRING, BASE_NONE, ((void *)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0 ) } }, { & dissect_dtls_hf .hf.hs_ja3s_full, { "JA3S Fullstring" , "dtls" ".handshake.ja3s_full", FT_STRING, BASE_NONE, ((void *)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0 ) } }, { & dissect_dtls_hf .hf.hs_ja3s_hash, { "JA3S", "dtls" ".handshake.ja3s", FT_STRING, BASE_NONE, ((void*)0), 0x0, (( void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ja4, { "JA4", "dtls" ".handshake.ja4" , FT_STRING, BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ja4_r, { "JA4_r", "dtls" ".handshake.ja4_r", FT_STRING, BASE_NONE, (( void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_ke_modes_length , { "PSK Key Exchange Modes Length", "dtls" ".extension.psk_ke_modes_length" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_psk_ke_mode , { "PSK Key Exchange Mode", "dtls" ".extension.psk_ke_mode", FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ( (tls_hello_ext_psk_ke_mode)))), 0x0, "Key exchange modes where the client supports use of PSKs" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_certificate_request_context_length, { "Certificate Request Context Length" , "dtls" ".handshake.certificate_request_context_length", FT_UINT8 , BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_certificate_request_context , { "Certificate Request Context", "dtls" ".handshake.certificate_request_context" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Value from CertificateRequest or empty for server auth" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_key_update_request_update, { "Key Update Request", "dtls" ".handshake.key_update.request_update", FT_UINT8, BASE_DEC, ( (0 ? (const struct _value_string*)0 : ((tls13_key_update_request )))), 0x00, "Whether the receiver should also update its keys" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.sct_scts_length, { "Serialized SCT List Length", "dtls" ".sct.scts_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.sct_sct_length , { "Serialized SCT Length", "dtls" ".sct.sct_length", FT_UINT16 , BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.sct_sct_version , { "SCT Version", "dtls" ".sct.sct_version", FT_UINT8, BASE_DEC , ((void*)0), 0x00, "SCT Protocol version (v1 (0) is defined in RFC 6962)" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.sct_sct_logid, { "Log ID", "dtls" ".sct.sct_logid", FT_BYTES , BASE_NONE, ((void*)0), 0x00, "SHA-256 hash of log's public key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.sct_sct_timestamp, { "Timestamp", "dtls" ".sct.sct_timestamp" , FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, ((void*)0), 0x00, "Timestamp of issuance" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.sct_sct_extensions_length, { "Extensions length", "dtls" ".sct.sct_extensions_length", FT_UINT16, BASE_DEC, ((void*)0 ), 0x00, "Length of future extensions to this protocol (currently none)" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.sct_sct_extensions, { "Extensions", "dtls" ".sct.sct_extensions" , FT_NONE, BASE_NONE, ((void*)0), 0x00, "Future extensions to this protocol (currently none)" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.sct_sct_signature_length, { "Signature Length", "dtls" ".sct.sct_signature_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.sct_sct_signature , { "Signature", "dtls" ".sct.sct_signature", FT_BYTES, BASE_NONE , ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_max_early_data_size , { "Maximum Early Data Size", "dtls" ".early_data.max_early_data_size" , FT_UINT32, BASE_DEC, ((void*)0), 0x00, "Maximum amount of 0-RTT data that the client may send" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_oid_filters_length, { "OID Filters Length", "dtls" ".extension.oid_filters_length", FT_UINT16, BASE_DEC, ((void *)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*) 0) } }, { & dissect_dtls_hf .hf.hs_ext_oid_filters_oid_length , { "Certificate Extension OID Length", "dtls" ".extension.oid_filters.oid_length" , FT_UINT8, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_oid_filters_oid , { "Certificate Extension OID", "dtls" ".extension.oid_filters.oid" , FT_OID, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_oid_filters_values_length , { "Certificate Extension Values Length", "dtls" ".extension.oid_filters.values_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cred_valid_time , { "Valid Time", "dtls" ".handshake.cred.valid_time", FT_UINT16 , BASE_DEC, ((void*)0), 0x0, "Delegated Credentials Valid Time" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cred_pubkey, { "Subject Public Key Info", "dtls" ".handshake.cred.pubkey" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Delegated Credentials Subject Public Key Info" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cred_pubkey_len, { "Subject Public Key Info Length", "dtls" ".handshake.cred.pubkey_len", FT_UINT24, BASE_DEC, ((void*)0 ), 0x0, "Delegated Credentials Subject Public Key Info Length" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cred_signature, { "Signature", "dtls" ".handshake.cred.signature" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Delegated Credentials Signature" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_cred_signature_len, { "Signature Length", "dtls" ".handshake.cred.signature_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Delegated Credentials Signature Length" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_compress_certificate_algorithms_length, { "Algorithms Length" , "dtls" ".compress_certificate.algorithms_length", FT_UINT8, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_compress_certificate_algorithm , { "Algorithm", "dtls" ".compress_certificate.algorithm", FT_UINT16 , BASE_DEC, ((0 ? (const struct _value_string*)0 : ((compress_certificate_algorithm_vals )))), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*) 0) } }, { & dissect_dtls_hf .hf.hs_ext_compress_certificate_uncompressed_length , { "Uncompressed Length", "dtls" ".compress_certificate.uncompressed_length" , FT_UINT24, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_compress_certificate_compressed_certificate_message_length , { "Length", "dtls" ".compress_certificate.compressed_certificate_message.length" , FT_UINT24, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_compress_certificate_compressed_certificate_message , { "Compressed Certificate Message", "dtls" ".compress_certificate.compressed_certificate_message" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_token_binding_version_major , { "Protocol Major Version", "dtls" ".token_binding.version_major" , FT_UINT8, BASE_HEX, ((void*)0), 0x00, "Major version of the Token Binding protocol" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_token_binding_version_minor, { "Protocol Minor Version" , "dtls" ".token_binding.version_minor", FT_UINT8, BASE_HEX, ( (void*)0), 0x00, "Minor version of the Token Binding protocol" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_token_binding_key_parameters, { "Key Parameters", "dtls" ".token_binding.key_parameters", FT_NONE, BASE_NONE, ( (void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0) } }, { & dissect_dtls_hf .hf.hs_ext_token_binding_key_parameters_length , { "Key Parameters Length", "dtls" ".token_binding.key_parameters_length" , FT_UINT8, BASE_DEC, ((void*)0), 0x00, "Length of the key parameters list" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_token_binding_key_parameter, { "Key Parameter", "dtls" ".token_binding.key_parameter", FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ((token_binding_key_parameter_vals )))), 0x00, "Identifier of the Token Binding key parameter", - 1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_record_size_limit, { "Record Size Limit", "dtls" ".record_size_limit" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, "Maximum record size that an endpoint is willing to receive" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_len, { "Parameters Length", "dtls" ".quic.len" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter , { "Parameter", "dtls" ".quic.parameter", FT_NONE, BASE_NONE , ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_type , { "Type", "dtls" ".quic.parameter.type", FT_UINT64, BASE_CUSTOM , ((const void *) (size_t) (quic_transport_parameter_id_base_custom )), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_len , { "Length", "dtls" ".quic.parameter.length", FT_UINT64, BASE_DEC , ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_len_old , { "Length", "dtls" ".quic.parameter.length.old", FT_UINT16, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_value , { "Value", "dtls" ".quic.parameter.value", FT_BYTES, BASE_NONE , ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_original_destination_connection_id , { "original_destination_connection_id", "dtls" ".quic.parameter.original_destination_connection_id" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, "Destination Connection ID from the first Initial packet sent by the client" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_max_idle_timeout, { "max_idle_timeout" , "dtls" ".quic.parameter.max_idle_timeout", FT_UINT64, BASE_DEC , ((void*)0), 0x00, "In milliseconds", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_stateless_reset_token , { "stateless_reset_token", "dtls" ".quic.parameter.stateless_reset_token" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, "Used in verifying a stateless reset" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_max_udp_payload_size, { "max_udp_payload_size" , "dtls" ".quic.parameter.max_udp_payload_size", FT_UINT64, BASE_DEC , ((void*)0), 0x00, "Maximum UDP payload size that the endpoint is willing to receive" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_initial_max_data, { "initial_max_data" , "dtls" ".quic.parameter.initial_max_data", FT_UINT64, BASE_DEC , ((void*)0), 0x00, "Contains the initial value for the maximum amount of data that can be sent on the connection" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_initial_max_stream_data_bidi_local , { "initial_max_stream_data_bidi_local", "dtls" ".quic.parameter.initial_max_stream_data_bidi_local" , FT_UINT64, BASE_DEC, ((void*)0), 0x00, "Initial stream maximum data for bidirectional, locally-initiated streams" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_initial_max_stream_data_bidi_remote , { "initial_max_stream_data_bidi_remote", "dtls" ".quic.parameter.initial_max_stream_data_bidi_remote" , FT_UINT64, BASE_DEC, ((void*)0), 0x00, "Initial stream maximum data for bidirectional, peer-initiated streams" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_initial_max_stream_data_uni, { "initial_max_stream_data_uni" , "dtls" ".quic.parameter.initial_max_stream_data_uni", FT_UINT64 , BASE_DEC, ((void*)0), 0x00, "Initial stream maximum data for unidirectional streams parameter" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_initial_max_streams_bidi, { "initial_max_streams_bidi" , "dtls" ".quic.parameter.initial_max_streams_bidi", FT_UINT64 , BASE_DEC, ((void*)0), 0x00, "Initial maximum number of application-owned bidirectional streams" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_initial_max_streams_uni, { "initial_max_streams_uni" , "dtls" ".quic.parameter.initial_max_streams_uni", FT_UINT64 , BASE_DEC, ((void*)0), 0x00, "Initial maximum number of application-owned unidirectional streams" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_ack_delay_exponent, { "ack_delay_exponent" , "dtls" ".quic.parameter.ack_delay_exponent", FT_UINT64, BASE_DEC , ((void*)0), 0x00, "Indicating an exponent used to decode the ACK Delay field in the ACK frame," , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_max_ack_delay, { "max_ack_delay" , "dtls" ".quic.parameter.max_ack_delay", FT_UINT64, BASE_DEC , ((void*)0), 0x00, "Indicating the maximum amount of time in milliseconds by which it will delay sending of acknowledgments" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_pa_ipv4address, { "ipv4Address", "dtls" ".quic.parameter.preferred_address.ipv4address", FT_IPv4 , BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_pa_ipv6address , { "ipv6Address", "dtls" ".quic.parameter.preferred_address.ipv6address" , FT_IPv6, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_pa_ipv4port , { "ipv4Port", "dtls" ".quic.parameter.preferred_address.ipv4port" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_pa_ipv6port , { "ipv6Port", "dtls" ".quic.parameter.preferred_address.ipv6port" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_pa_connectionid_length , { "Length", "dtls" ".quic.parameter.preferred_address.connectionid.length" , FT_UINT8, BASE_DEC, ((void*)0), 0x00, "Length of connectionId Field" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_pa_connectionid, { "connectionId" , "dtls" ".quic.parameter.preferred_address.connectionid", FT_BYTES , BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_pa_statelessresettoken , { "statelessResetToken", "dtls" ".quic.parameter.preferred_address.statelessresettoken" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_active_connection_id_limit , { "Active Connection ID Limit", "dtls" ".quic.parameter.active_connection_id_limit" , FT_UINT64, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_initial_source_connection_id , { "Initial Source Connection ID", "dtls" ".quic.parameter.initial_source_connection_id" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_retry_source_connection_id , { "Retry Source Connection ID", "dtls" ".quic.parameter.retry_source_connection_id" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_max_datagram_frame_size , { "max_datagram_frame_size", "dtls" ".quic.parameter.max_datagram_frame_size" , FT_UINT64, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_cibir_encoding_length , { "length", "dtls" ".quic.parameter.cibir_encoding.length", FT_UINT64, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_cibir_encoding_offset , { "offset", "dtls" ".quic.parameter.cibir_encoding.offset", FT_UINT64, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_loss_bits , { "loss_bits", "dtls" ".quic.parameter.loss_bits", FT_UINT64 , BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_address_discovery , { "address_discovery", "dtls" ".quic.parameter.address_discovery" , FT_UINT64, BASE_DEC|0x00000400, ((0 ? (const struct _val64_string *)0 : ((quic_address_discovery_vals)))), 0x00, ((void*)0), -1 , 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_enable_time_stamp_v2, { "Enable TimestampV2" , "dtls" ".quic.parameter.enable_time_stamp_v2", FT_UINT64, BASE_DEC |0x00000400, ((0 ? (const struct _val64_string*)0 : ((quic_enable_time_stamp_v2_vals )))), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*) 0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_min_ack_delay , { "min_ack_delay", "dtls" ".quic.parameter.min_ack_delay", FT_UINT64 , BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_user_agent_id , { "Google UserAgent", "dtls" ".quic.parameter.google.user_agent" , FT_STRING, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_key_update_not_yet_supported , { "Google Key Update not yet supported", "dtls" ".quic.parameter.google.key_update_not_yet_supported" , FT_NONE, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_quic_version , { "Google QUIC version", "dtls" ".quic.parameter.google.quic_version" , FT_UINT32, 0x00000100 | BASE_HEX, ((0 ? (const struct _range_string *)0 : ((quic_version_vals)))), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_initial_rtt , { "Google Initial RTT", "dtls" ".quic.parameter.google.initial_rtt" , FT_UINT64, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_support_handshake_done , { "Google Support Handshake Done", "dtls" ".quic.parameter.google.support_handshake_done" , FT_NONE, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_quic_params , { "Google QUIC parameters", "dtls" ".quic.parameter.google.quic_params" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_quic_params_unknown_field , { "Google Unknown Field", "dtls" ".quic.parameter.google.quic_params_unknown_field" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_connection_options , { "Google Connection options", "dtls" ".quic.parameter.google.connection_options" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_supported_versions_length , { "Google Supported Versions Length", "dtls" ".quic.parameter.google.supported_versions_length" , FT_UINT8, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_google_supported_version , { "Google Supported Version", "dtls" ".quic.parameter.google.supported_version" , FT_UINT32, 0x00000100 | BASE_HEX, ((0 ? (const struct _range_string *)0 : ((quic_version_vals)))), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_facebook_partial_reliability , { "Facebook Partial Reliability", "dtls" ".quic.parameter.facebook.partial_reliability" , FT_UINT64, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_chosen_version , { "Chosen Version", "dtls" ".quic.parameter.vi.chosen_version" , FT_UINT32, 0x00000100 | BASE_HEX, ((0 ? (const struct _range_string *)0 : ((quic_version_vals)))), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_other_version , { "Other Version", "dtls" ".quic.parameter.vi.other_version" , FT_UINT32, 0x00000100 | BASE_HEX, ((0 ? (const struct _range_string *)0 : ((quic_version_vals)))), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_enable_multipath , { "Enable Multipath", "dtls" ".quic.parameter.enable_multipath" , FT_UINT64, BASE_DEC|0x00000400, ((0 ? (const struct _val64_string *)0 : ((quic_enable_multipath_vals)))), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_initial_max_paths, { "Initial Max Paths" , "dtls" ".quic.parameter.initial_max_paths", FT_UINT64, BASE_DEC , ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_quictp_parameter_initial_max_path_id , { "Initial Max Path ID", "dtls" ".quic.parameter.initial_max_path_id" , FT_UINT64, BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_connection_id_length , { "Connection ID length", "dtls" ".connection_id_length", FT_UINT8 , BASE_DEC, ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_connection_id , { "Connection ID", "dtls" ".connection_id", FT_BYTES, BASE_NONE , ((void*)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_trusted_ca_keys_len , { "Trusted CA keys length", "dtls" ".handshake.trusted_ca.keys_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x00, "Length of Trusted CA keys extension" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_trusted_ca_keys_list, { "Trusted CA keys", "dtls" ".handshake.trusted_ca.keys", FT_NONE, BASE_NONE, ((void*)0) , 0x00, "List of Trusted CA keys", -1, 0, HF_REF_TYPE_NONE, - 1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_trusted_ca_key , { "Trusted CA key", "dtls" ".handshake.trusted_ca.key", FT_NONE , BASE_NONE, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_trusted_ca_key_type , { "Trusted CA key type", "dtls" ".handshake.trusted_ca.key_type" , FT_UINT8, BASE_DEC, ((0 ? (const struct _value_string*)0 : ( (tls_hello_ext_trusted_ca_key_type)))), 0x00, "Type of Trusted CA key" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_trusted_ca_key_hash, { "Trusted CA key hash", "dtls" ".handshake.trusted_ca.key_hash", FT_BYTES, BASE_NONE, ((void *)0), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*) 0) } }, { & dissect_dtls_hf .hf.hs_ext_trusted_ca_key_dname_len , { "Distinguished Name Length", "dtls" ".handshake.trusted_ca.key_dname_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of distinguished name" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_trusted_ca_key_dname, { "Distinguished Name", "dtls" ".handshake.trusted_ca.key_dname", FT_NONE, BASE_NONE, ((void *)0), 0x0, "Distinguished name of a CA that the client trusts" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.esni_suite, { "Cipher Suite", "dtls" ".esni.suite", FT_UINT16 , BASE_HEX|0x00000200, &ssl_31_ciphersuite_ext, 0x0, "Cipher suite used to encrypt the SNI" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.esni_record_digest_length, { "Record Digest Length", "dtls" ".esni.record_digest_length", FT_UINT16, BASE_DEC, ((void*)0 ), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.esni_record_digest, { "Record Digest" , "dtls" ".esni.record_digest", FT_BYTES, BASE_NONE, ((void*) 0), 0x00, "Cryptographic hash of the ESNIKeys from which the ESNI key was obtained" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.esni_encrypted_sni_length, { "Encrypted SNI Length", "dtls" ".esni.encrypted_sni_length", FT_UINT16, BASE_DEC, ((void*)0 ), 0x00, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.esni_encrypted_sni, { "Encrypted SNI" , "dtls" ".esni.encrypted_sni", FT_BYTES, BASE_NONE, ((void*) 0), 0x00, "The encrypted ClientESNIInner structure", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.esni_nonce, { "Nonce", "dtls" ".esni.nonce", FT_BYTES, BASE_NONE, ((void *)0), 0x00, "Contents of ClientESNIInner.nonce", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfiglist_length , { "ECHConfigList length", "dtls" ".ech.echconfiglist_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Encrypted ClientHello (ECH) Configurations length" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfiglist, { "ECHConfigList", "dtls" ".ech.echconfiglist" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "Encrypted ClientHello (ECH) Configurations" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfig, { "ECHConfig", "dtls" ".ech.echconfig", FT_NONE , BASE_NONE, ((void*)0), 0x0, "Encrypted ClientHello (ECH) Configuration" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfig_version, { "Version", "dtls" ".ech.echconfig.version" , FT_UINT16, BASE_HEX, ((void*)0), 0x0, "Encrypted ClientHello: ECHConfig version" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfig_length, { "Length", "dtls" ".ech.echconfig.length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Encrypted ClientHello: ECHConfig length" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfigcontents_maximum_name_length, { "Maximum Name Length" , "dtls" ".ech.echconfigcontents.maximum_name_length", FT_UINT8 , BASE_DEC, ((void*)0), 0x0, "The longest name of a backend server, if known" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfigcontents_public_name_length, { "Public Name length" , "dtls" ".ech.echconfigcontents.public_name_length", FT_UINT8 , BASE_DEC, ((void*)0), 0x0, "Length of the Public Name field" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfigcontents_public_name, { "Public Name", "dtls" ".ech.echconfigcontents.public_name", FT_STRING, BASE_NONE, ( (void*)0), 0x0, "The DNS name of the client-facing server, i.e., the entity trusted to update the ECH configuration" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfigcontents_extensions_length, { "Extensions length" , "dtls" ".ech.echconfigcontents.extensions_length", FT_UINT16 , BASE_DEC, ((void*)0), 0x0, "Length of the Extensions field" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_echconfigcontents_extensions, { "Extensions", "dtls" ".ech.echconfigcontents.extensions", FT_BYTES, BASE_NONE, (( void*)0), 0x0, "A list of extensions that the client must take into consideration when generating a ClientHello message" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig, { "HPKE Key Config", "dtls" ".ech.hpke.keyconfig" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "HPKE Key Config", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig_config_id, { "Config Id", "dtls" ".ech.hpke.keyconfig.config_id" , FT_UINT8, BASE_DEC, ((void*)0), 0x0, "HPKE Config Id", -1, 0 , HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig_kem_id, { "KEM Id", "dtls" ".ech.hpke.keyconfig.kem_id" , FT_UINT16, BASE_DEC, ((0 ? (const struct _value_string*)0 : ((kem_id_type_vals)))), 0x0, "HPKE KEM Id", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig_public_key_length , { "Public Key length", "dtls" ".ech.hpke.keyconfig.public_key_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "HPKE Public Key length" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig_public_key, { "Public Key", "dtls" ".ech.hpke.keyconfig.public_key" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "HPKE Public Key", -1 , 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig_cipher_suites, { "Cipher Suites", "dtls" ".ech.hpke.keyconfig.cipher_suites", FT_NONE, BASE_NONE, ((void *)0), 0x0, "HPKE Cipher Suites", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig_cipher_suites_length , { "Cipher Suites length", "dtls" ".ech.hpke.keyconfig.cipher_suites_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "HPKE Cipher Suites length" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig_cipher_suite, { "Cipher Suite", "dtls" ".ech.hpke.keyconfig.cipher_suite", FT_NONE, BASE_NONE, ((void *)0), 0x0, "HPKE Cipher Suite", -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig_cipher_suite_kdf_id , { "KDF Id", "dtls" ".ech.hpke.keyconfig.cipher_suite.kdf_id" , FT_UINT16, BASE_DEC, ((0 ? (const struct _value_string*)0 : ((kdf_id_type_vals)))), 0x0, "HPKE KDF Id", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_hpke_keyconfig_cipher_suite_aead_id , { "AEAD Id", "dtls" ".ech.hpke.keyconfig.cipher_suite.aead_id" , FT_UINT16, BASE_DEC, ((0 ? (const struct _value_string*)0 : ((aead_id_type_vals)))), 0x0, "HPKE AEAD Id", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_clienthello_type , { "Client Hello type", "dtls" ".ech.client_hello_type", FT_UINT8 , BASE_DEC, ((0 ? (const struct _value_string*)0 : ((tls_hello_ext_ech_clienthello_types )))), 0x0, "Client Hello type", -1, 0, HF_REF_TYPE_NONE, -1, ( (void*)0) } }, { & dissect_dtls_hf .hf.ech_cipher_suite, { "Cipher Suite", "dtls" ".ech.cipher_suite", FT_NONE, BASE_NONE , ((void*)0), 0x0, "The cipher suite used to encrypt ClientHelloInner" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_config_id, { "Config Id", "dtls" ".ech.config_id", FT_UINT8 , BASE_DEC, ((void*)0), 0x0, "The ECHConfigContents.key_config.config_id for the chosen ECHConfig" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_enc_length, { "Enc length", "dtls" ".ech.enc_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_enc, { "Enc" , "dtls" ".ech.enc", FT_BYTES, BASE_NONE, ((void*)0), 0x0, "The HPKE encapsulated key, used by servers to decrypt the corresponding payload field" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_payload_length, { "Payload length", "dtls" ".ech.payload_length" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Payload Length", -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_payload, { "Payload", "dtls" ".ech.payload", FT_BYTES , BASE_NONE, ((void*)0), 0x0, "The serialized and encrypted ClientHelloInner structure" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_confirmation, { "Confirmation", "dtls" ".ech.confirmation" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Confirmation of ECH acceptance in a HelloRetryRequest" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_retry_configs, { "Retry Configs", "dtls" ".ech.retry_configs" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "ECHConfig structures for one-time use by the client in a retry connection" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.ech_padding_data, { "ECH Encrypted Padding", "dtls" ".ech.encrypted_padding" , FT_BYTES, BASE_NONE, ((void*)0), 0x0, "Must be zero", -1, 0 , HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_alps_len, { "ALPS Extension Length", "dtls" ".handshake.extensions_alps_len" , FT_UINT16, BASE_DEC, ((void*)0), 0x0, "Length of the ALPS Extension" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_alps_alpn_list, { "Supported ALPN List", "dtls" ".handshake.extensions_alps_alpn_list" , FT_NONE, BASE_NONE, ((void*)0), 0x0, "List of supported ALPN by ALPS" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_alps_alpn_str_len, { "Supported ALPN Length", "dtls" ".handshake.extensions_alps_alpn_str_len", FT_UINT8, BASE_DEC , ((void*)0), 0x0, "Length of ALPN string", -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_alps_alpn_str , { "Supported ALPN", "dtls" ".handshake.extensions_alps_alpn_str" , FT_STRING, BASE_NONE, ((void*)0), 0x00, "ALPN supported by ALPS" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } }, { & dissect_dtls_hf .hf.hs_ext_alps_settings, { "ALPN Opaque Settings", "dtls" ".handshake.extensions_alps.settings" , FT_BYTES, BASE_NONE, ((void*)0), 0x00, "ALPN Opaque Settings" , -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } } | |||
| 3160 | }; | |||
| 3161 | ||||
| 3162 | /* Setup protocol subtree array */ | |||
| 3163 | static int *ett[] = { | |||
| 3164 | &ett_dtls, | |||
| 3165 | &ett_dtls_record, | |||
| 3166 | &ett_dtls_alert, | |||
| 3167 | &ett_dtls_handshake, | |||
| 3168 | &ett_dtls_heartbeat, | |||
| 3169 | &ett_dtls_ack, | |||
| 3170 | &ett_dtls_ack_record_number, | |||
| 3171 | &ett_dtls_ack_record_numbers, | |||
| 3172 | &ett_dtls_certs, | |||
| 3173 | &ett_dtls_uni_hdr, | |||
| 3174 | &ett_dtls_fragment, | |||
| 3175 | &ett_dtls_fragments, | |||
| 3176 | SSL_COMMON_ETT_LIST(dissect_dtls_hf)& dissect_dtls_hf .ett.hs_ext, & dissect_dtls_hf .ett .hs_ext_alpn, & dissect_dtls_hf .ett.hs_ext_cert_types, & dissect_dtls_hf .ett.hs_ext_groups, & dissect_dtls_hf .ett .hs_ext_curves_point_formats, & dissect_dtls_hf .ett.hs_ext_npn , & dissect_dtls_hf .ett.hs_ext_reneg_info, & dissect_dtls_hf .ett.hs_ext_key_share, & dissect_dtls_hf .ett.hs_ext_key_share_ks , & dissect_dtls_hf .ett.hs_ext_pre_shared_key, & dissect_dtls_hf .ett.hs_ext_psk_identity, & dissect_dtls_hf .ett.hs_ext_psk_binders , & dissect_dtls_hf .ett.hs_ext_psk_binder, & dissect_dtls_hf .ett.hs_ext_server_name, & dissect_dtls_hf .ett.hs_ext_oid_filter , & dissect_dtls_hf .ett.hs_ext_quictp_parameter, & dissect_dtls_hf .ett.hs_ext_trusted_ca_keys, & dissect_dtls_hf .ett.hs_ext_trusted_ca_key , & dissect_dtls_hf .ett.hs_sig_hash_alg, & dissect_dtls_hf .ett.hs_sig_hash_algs, & dissect_dtls_hf .ett.urlhash, & dissect_dtls_hf .ett.keyex_params, & dissect_dtls_hf .ett .certificates, & dissect_dtls_hf .ett.cert_types, & dissect_dtls_hf .ett.dnames, & dissect_dtls_hf .ett.hs_random, & dissect_dtls_hf .ett.cipher_suites, & dissect_dtls_hf .ett.comp_methods, & dissect_dtls_hf .ett.session_ticket, & dissect_dtls_hf .ett.sct, & dissect_dtls_hf .ett.cert_status, & dissect_dtls_hf .ett.ocsp_response, & dissect_dtls_hf .ett.uncompressed_certificates , & dissect_dtls_hf .ett.hs_ext_alps, & dissect_dtls_hf .ett.ech_echconfiglist, & dissect_dtls_hf .ett.ech_echconfig , & dissect_dtls_hf .ett.ech_retry_configs, & dissect_dtls_hf .ett.ech_hpke_keyconfig, & dissect_dtls_hf .ett.ech_hpke_cipher_suites , & dissect_dtls_hf .ett.ech_hpke_cipher_suite, & dissect_dtls_hf .ett.ech_decrypt, & dissect_dtls_hf .ett.hs_ext_token_binding_key_parameters , | |||
| 3177 | }; | |||
| 3178 | ||||
| 3179 | static ei_register_info ei[] = { | |||
| 3180 | { &ei_dtls_handshake_too_many_fragments, { "dtls.handshake.too_many_fragments", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "Too many fragments in the handshake message, fragment not reassembled", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, | |||
| 3181 | { &ei_dtls_handshake_fragment_length_zero, { "dtls.handshake.fragment_length.zero", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "Zero-length fragment length for fragmented message", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, | |||
| 3182 | { &ei_dtls_handshake_fragment_length_too_long, { "dtls.handshake.fragment_length.too_long", PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "Fragment length is larger than message length", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, | |||
| 3183 | { &ei_dtls_handshake_fragment_past_end_msg, { "dtls.handshake.fragment_past_end_msg", PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "Fragment runs past the end of the message", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, | |||
| 3184 | { &ei_dtls_msg_len_diff_fragment, { "dtls.msg_len_diff_fragment", PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "Message length differs from value in earlier fragment", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, | |||
| 3185 | { &ei_dtls_heartbeat_payload_length, { "dtls.heartbeat_message.payload_length.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Invalid heartbeat payload length", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, | |||
| 3186 | { &ei_dtls_cid_invalid_content_type, { "dtls.cid.content_type.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Invalid real content type", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, | |||
| 3187 | { &ei_dtls_use_srtp_profiles_length, { "dtls.use_srtp.protection_profiles_length.invalid", PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "Invalid protection profiles length", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, | |||
| 3188 | #if 0 | |||
| 3189 | { &ei_dtls_cid_invalid_enc_content, { "dtls.cid.enc_content.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Invalid encrypted content", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} }}, | |||
| 3190 | #endif | |||
| 3191 | ||||
| 3192 | SSL_COMMON_EI_LIST(dissect_dtls_hf, "dtls"){ & dissect_dtls_hf .ei.client_version_error, { "dtls" ".handshake.client_version_error" , 0x09000000, 0x00600000, "Client Hello legacy version field specifies version 1.3, not version 1.2; some servers may not be able to handle that." , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.server_version_error , { "dtls" ".handshake.server_version_error", 0x09000000, 0x00600000 , "Server Hello legacy version field specifies version 1.3, not version 1.2; some middleboxes may not be able to handle that." , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.legacy_version , { "dtls" ".handshake.legacy_version", 0x0e000000, 0x00200000 , "This legacy_version field MUST be ignored. The supported_versions extension is present and MUST be used instead." , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.malformed_vector_length , { "dtls" ".malformed.vector_length", 0x09000000, 0x00600000 , "Variable vector length is outside the permitted range", 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.malformed_buffer_too_small , { "dtls" ".malformed.buffer_too_small", 0x07000000, 0x00800000 , "Malformed message, not enough data is available", 0, ((void *)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} } }, { & dissect_dtls_hf .ei.malformed_trailing_data , { "dtls" ".malformed.trailing_data", 0x09000000, 0x00600000 , "Undecoded trailing data is present", 0, ((void*)0), 0, ((void *)0), {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void *)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} } } }, { & dissect_dtls_hf .ei.hs_ext_cert_status_undecoded , { "dtls" ".handshake.status_request.undecoded", 0x05000000, 0x00400000, "Responder ID list or Request Extensions are not implemented" , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.hs_ciphersuite_undecoded , { "dtls" ".handshake.ciphersuite.undecoded", 0x05000000, 0x00400000 , "Ciphersuite not implemented", 0, ((void*)0), 0, ((void*)0) , {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void*)0) , 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}} } } , { & dissect_dtls_hf .ei.hs_srv_keyex_illegal, { "dtls" ".handshake.server_keyex_illegal" , 0x09000000, 0x00600000, "It is not legal to send the ServerKeyExchange message for this ciphersuite" , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.resumed, { "dtls" ".resumed", 0x02000000, 0x00400000, "This session reuses previously negotiated keys (Session resumption)" , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.record_length_invalid , { "dtls" ".record.length.invalid", 0x09000000, 0x00800000, "Record fragment length is too small or too large" , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.decompression_error , { "dtls" ".decompression_error", 0x09000000, 0x00800000, "Decompression error" , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.ech_echconfig_invalid_version , { "dtls" ".ech_echconfig_invalid_version", 0x09000000, 0x00800000 , "Invalid/unknown ECHConfig version", 0, ((void*)0), 0, ((void *)0), {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE, ((void *)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} } } }, { & dissect_dtls_hf .ei.ech_accepted, { "dtls" ".ech_accepted" , 0x09000000, 0x00400000, "Calculated ECH Confirmation matches Server Random bytes, ECH was accepted" , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }, { & dissect_dtls_hf .ei.ech_rejected , { "dtls" ".ech_rejected", 0x09000000, 0x00600000, "Calculated ECH Confirmation does not match Server Random bytes, ECH was rejected" , 0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } } | |||
| 3193 | }; | |||
| 3194 | ||||
| 3195 | static build_valid_func dtls_da_src_values[1] = {dtls_src_value}; | |||
| 3196 | static build_valid_func dtls_da_dst_values[1] = {dtls_dst_value}; | |||
| 3197 | static build_valid_func dtls_da_both_values[2] = {dtls_src_value, dtls_dst_value}; | |||
| 3198 | static decode_as_value_t dtls_da_values[3] = {{dtls_src_prompt, 1, dtls_da_src_values}, {dtls_dst_prompt, 1, dtls_da_dst_values}, {dtls_both_prompt, 2, dtls_da_both_values}}; | |||
| 3199 | static decode_as_t dtls_da = {"dtls", "dtls.port", 3, 2, dtls_da_values, "UDP", "port(s) as", | |||
| 3200 | decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL((void*)0), NULL((void*)0), NULL((void*)0) }; | |||
| 3201 | ||||
| 3202 | expert_module_t* expert_dtls; | |||
| 3203 | ||||
| 3204 | /* Register the protocol name and description */ | |||
| 3205 | proto_dtls = proto_register_protocol("Datagram Transport Layer Security", | |||
| 3206 | "DTLS", "dtls"); | |||
| 3207 | ||||
| 3208 | dtls_associations = register_dissector_table("dtls.port", "DTLS Port", proto_dtls, FT_UINT16, BASE_DEC); | |||
| 3209 | ||||
| 3210 | ssl_common_register_dtls_alpn_dissector_table("dtls.alpn", | |||
| 3211 | "DTLS Application-Layer Protocol Negotiation (ALPN) Protocol IDs", | |||
| 3212 | proto_dtls); | |||
| 3213 | ||||
| 3214 | /* Required function calls to register the header fields and | |||
| 3215 | * subtrees used */ | |||
| 3216 | proto_register_field_array(proto_dtls, hf, array_length(hf)(sizeof (hf) / sizeof (hf)[0])); | |||
| 3217 | proto_register_subtree_array(ett, array_length(ett)(sizeof (ett) / sizeof (ett)[0])); | |||
| 3218 | expert_dtls = expert_register_protocol(proto_dtls); | |||
| 3219 | expert_register_field_array(expert_dtls, ei, array_length(ei)(sizeof (ei) / sizeof (ei)[0])); | |||
| 3220 | ||||
| 3221 | { | |||
| 3222 | module_t *dtls_module = prefs_register_protocol(proto_dtls, proto_reg_handoff_dtls); | |||
| 3223 | ||||
| 3224 | #ifdef HAVE_LIBGNUTLS1 | |||
| 3225 | static uat_field_t dtlskeylist_uats_flds[] = { | |||
| 3226 | UAT_FLD_CSTRING_OTHER(sslkeylist_uats, ipaddr, "IP address", ssldecrypt_uat_fld_ip_chk_cb, "IPv4 or IPv6 address (unused)"){"ipaddr", "IP address", PT_TXTMOD_STRING,{ ssldecrypt_uat_fld_ip_chk_cb ,sslkeylist_uats_ipaddr_set_cb,sslkeylist_uats_ipaddr_tostr_cb },{0,0,0},0,"IPv4 or IPv6 address (unused)",((void*)0)}, | |||
| 3227 | UAT_FLD_CSTRING_OTHER(sslkeylist_uats, port, "Port", ssldecrypt_uat_fld_port_chk_cb, "Port Number (optional)"){"port", "Port", PT_TXTMOD_STRING,{ ssldecrypt_uat_fld_port_chk_cb ,sslkeylist_uats_port_set_cb,sslkeylist_uats_port_tostr_cb}, {0,0,0},0,"Port Number (optional)",((void*)0)}, | |||
| 3228 | UAT_FLD_DISSECTOR_OTHER(sslkeylist_uats, protocol, "Protocol", dtlsdecrypt_uat_fld_protocol_chk_cb, "Application Layer Protocol (optional)"){"protocol", "Protocol", PT_TXTMOD_DISSECTOR,{dtlsdecrypt_uat_fld_protocol_chk_cb ,sslkeylist_uats_protocol_set_cb,sslkeylist_uats_protocol_tostr_cb },{0,0,0},0,"Application Layer Protocol (optional)",((void*)0 )}, | |||
| 3229 | UAT_FLD_FILENAME_OTHER(sslkeylist_uats, keyfile, "Key File", ssldecrypt_uat_fld_fileopen_chk_cb, "Path to the keyfile."){"keyfile", "Key File", PT_TXTMOD_FILENAME,{ssldecrypt_uat_fld_fileopen_chk_cb ,sslkeylist_uats_keyfile_set_cb,sslkeylist_uats_keyfile_tostr_cb },{0,0,0},0,"Path to the keyfile.",((void*)0)}, | |||
| 3230 | UAT_FLD_CSTRING_OTHER(sslkeylist_uats, password," Password (p12 file)", ssldecrypt_uat_fld_password_chk_cb, "Password"){"password", " Password (p12 file)", PT_TXTMOD_STRING,{ ssldecrypt_uat_fld_password_chk_cb ,sslkeylist_uats_password_set_cb,sslkeylist_uats_password_tostr_cb },{0,0,0},0,"Password",((void*)0)}, | |||
| 3231 | UAT_END_FIELDS{((void*)0),((void*)0),PT_TXTMOD_NONE,{0,0,0},{0,0,0},0,0,((void *)0)} | |||
| 3232 | }; | |||
| 3233 | ||||
| 3234 | dtlsdecrypt_uat = uat_new("DTLS RSA Keylist", | |||
| 3235 | sizeof(ssldecrypt_assoc_t), | |||
| 3236 | "dtlsdecrypttablefile", /* filename */ | |||
| 3237 | true1, /* from_profile */ | |||
| 3238 | &dtlskeylist_uats, /* data_ptr */ | |||
| 3239 | &ndtlsdecrypt, /* numitems_ptr */ | |||
| 3240 | UAT_AFFECTS_DISSECTION0x00000001, /* affects dissection of packets, but not set of named fields */ | |||
| 3241 | NULL((void*)0), /* TODO, need revision - help */ | |||
| 3242 | dtlsdecrypt_copy_cb, | |||
| 3243 | NULL((void*)0), /* dtlsdecrypt_update_cb? */ | |||
| 3244 | dtlsdecrypt_free_cb, | |||
| 3245 | dtls_parse_uat, | |||
| 3246 | dtls_reset_uat, | |||
| 3247 | dtlskeylist_uats_flds); | |||
| 3248 | ||||
| 3249 | prefs_register_uat_preference(dtls_module, "cfg", | |||
| 3250 | "RSA keys list", | |||
| 3251 | "A table of RSA keys for DTLS decryption", | |||
| 3252 | dtlsdecrypt_uat); | |||
| 3253 | ||||
| 3254 | prefs_register_obsolete_preference(dtls_module, "keys_list"); | |||
| 3255 | #endif /* HAVE_LIBGNUTLS */ | |||
| 3256 | ||||
| 3257 | prefs_register_filename_preference(dtls_module, "debug_file", "DTLS debug file", | |||
| 3258 | "redirect dtls debug to file name; leave empty to disable debug, " | |||
| 3259 | "use \"" SSL_DEBUG_USE_STDERR"-" "\" to redirect output to stderr\n", | |||
| 3260 | &dtls_debug_file_name, true1); | |||
| 3261 | ||||
| 3262 | prefs_register_uint_preference(dtls_module, "client_cid_length", "Client Connection ID length", | |||
| 3263 | "Default client Connection ID length used when the Client Handshake message is missing", | |||
| 3264 | 10, &dtls_default_client_cid_length); | |||
| 3265 | ||||
| 3266 | prefs_register_uint_preference(dtls_module, "server_cid_length", "Server Connection ID length", | |||
| 3267 | "Default server Connection ID length used when the Server Handshake message is missing", | |||
| 3268 | 10, &dtls_default_server_cid_length); | |||
| 3269 | ||||
| 3270 | ssl_common_register_options(dtls_module, &dtls_options, true1); | |||
| 3271 | } | |||
| 3272 | ||||
| 3273 | dtls_handle = register_dissector("dtls", dissect_dtls, proto_dtls); | |||
| 3274 | ||||
| 3275 | register_init_routine(dtls_init); | |||
| 3276 | register_cleanup_routine(dtls_cleanup); | |||
| 3277 | reassembly_table_register (&dtls_reassembly_table, &addresses_ports_reassembly_table_functions); | |||
| 3278 | register_decode_as(&dtls_da); | |||
| 3279 | ||||
| 3280 | dtls_tap = register_tap("dtls"); | |||
| 3281 | ssl_debug_printf("proto_register_dtls: registered tap %s:%d\n", | |||
| 3282 | "dtls", dtls_tap); | |||
| 3283 | ||||
| 3284 | heur_subdissector_list = register_heur_dissector_list_with_description("dtls", "DTLS payload fallback", proto_dtls); | |||
| 3285 | ||||
| 3286 | register_follow_stream(proto_dtls, "dtls_follow", dtls_follow_conv_filter, dtls_follow_index_filter, | |||
| 3287 | udp_follow_address_filter, udp_port_to_display, ssl_follow_tap_listener, get_dtls_stream_count, NULL((void*)0)); | |||
| 3288 | ||||
| 3289 | dtls_follow_tap = register_tap("dtls_follow"); | |||
| 3290 | } | |||
| 3291 | ||||
| 3292 | ||||
| 3293 | /* If this dissector uses sub-dissector registration add a registration | |||
| 3294 | * routine. This format is required because a script is used to find | |||
| 3295 | * these routines and create the code that calls these routines. | |||
| 3296 | */ | |||
| 3297 | void | |||
| 3298 | proto_reg_handoff_dtls(void) | |||
| 3299 | { | |||
| 3300 | static bool_Bool initialized = false0; | |||
| 3301 | ||||
| 3302 | #ifdef HAVE_LIBGNUTLS1 | |||
| 3303 | dtls_parse_uat(); | |||
| 3304 | #endif | |||
| 3305 | ||||
| 3306 | if (initialized == false0) { | |||
| 3307 | heur_dissector_add("udp", dissect_dtls_heur, "DTLS over UDP", "dtls_udp", proto_dtls, HEURISTIC_ENABLE); | |||
| 3308 | heur_dissector_add("stun", dissect_dtls_heur, "DTLS over STUN", "dtls_stun", proto_dtls, HEURISTIC_DISABLE); | |||
| 3309 | heur_dissector_add("classicstun", dissect_dtls_heur, "DTLS over CLASSICSTUN", "dtls_classicstun", proto_dtls, HEURISTIC_DISABLE); | |||
| 3310 | dissector_add_uint("sctp.ppi", DIAMETER_DTLS_PROTOCOL_ID47, dtls_handle); | |||
| 3311 | dissector_add_uint("sctp.ppi", NGAP_OVER_DTLS_PROTOCOL_ID66, dtls_handle); | |||
| 3312 | dissector_add_uint("sctp.ppi", XNAP_OVER_DTLS_PROTOCOL_ID67, dtls_handle); | |||
| 3313 | dissector_add_uint("sctp.ppi", F1AP_OVER_DTLS_PROTOCOL_ID68, dtls_handle); | |||
| 3314 | dissector_add_uint("sctp.ppi", E1AP_OVER_DTLS_PROTOCOL_ID69, dtls_handle); | |||
| 3315 | exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7"OSI layer 7"); | |||
| 3316 | } | |||
| 3317 | ||||
| 3318 | initialized = true1; | |||
| 3319 | } | |||
| 3320 | ||||
| 3321 | void | |||
| 3322 | dtls_dissector_add(unsigned port, dissector_handle_t handle) | |||
| 3323 | { | |||
| 3324 | if (dtls_handle) { | |||
| 3325 | dissector_delete_uint("udp.port", port, dtls_handle); | |||
| 3326 | ssl_association_add("dtls.port", dtls_handle, handle, port, false0); | |||
| 3327 | } | |||
| 3328 | } | |||
| 3329 | ||||
| 3330 | void | |||
| 3331 | dtls_dissector_delete(unsigned port, dissector_handle_t handle) | |||
| 3332 | { | |||
| 3333 | ssl_association_remove("dtls.port", dtls_handle, handle, port, false0); | |||
| 3334 | } | |||
| 3335 | ||||
| 3336 | /* | |||
| 3337 | * Editor modelines - https://www.wireshark.org/tools/modelines.html | |||
| 3338 | * | |||
| 3339 | * Local Variables: | |||
| 3340 | * c-basic-offset: 2 | |||
| 3341 | * tab-width: 8 | |||
| 3342 | * indent-tabs-mode: nil | |||
| 3343 | * End: | |||
| 3344 | * | |||
| 3345 | * ex: set shiftwidth=2 tabstop=8 expandtab: | |||
| 3346 | * :indentSize=2:tabSize=8:noTabs=true: | |||
| 3347 | */ |