2 * Routines for WAI packet dissection
3 * Based on: WAPI ISO submission - ISO/IEC JTC 1 N 9880 [ref: 1]
4 * chapter "8.1.4 WAI protocol"
6 * Written by Lukasz Kotasa <lukasz.kotasa@tieto.com>
7 * Lukasz Suchy <lukasz.suchy@tieto.com>
8 * Copyright 2010, Tieto.
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * SPDX-License-Identifier: GPL-2.0-or-later
16 /* Protocol reference:
17 * http://isotc.iso.org/livelink/livelink?func=ll&objId=8500308&objAction=Open&ei=nt-RTKe1IJKTjAeepLS8BQ&usg=AFQjCNEn8hlU_SfoAGkM-X48JL_BL8bptA&sig2=JOHNPrqgCMO4q0cWhAfkow
18 * (chapter: 8.1.4. WAI protocol)
24 #include <epan/packet.h>
25 #include <epan/etypes.h>
26 #include <epan/reassemble.h>
28 #include <wsutil/array.h>
30 #define WAI_SUB_PRE_AUTHENTICATION 0x01 /* pre-authentication start */
31 #define WAI_SUB_STAKEY_REQ 0x02 /* STAKey request */
32 #define WAI_SUB_AUTH_ACTIVATION 0x03 /* authentication activation */
33 #define WAI_SUB_ACCESS_AUTH_REQ 0x04 /* access authentication request */
34 #define WAI_SUB_ACCESS_AUTH_RESP 0x05 /* access authentication response */
35 #define WAI_SUB_CERT_AUTH_REQ 0x06 /* certificate authentication request */
36 #define WAI_SUB_CERT_AUTH_RESP 0x07 /* certificate authentication response */
37 #define WAI_SUB_UNICAST_KEY_REQ 0x08 /* unicast key negotiation request */
38 #define WAI_SUB_UNICAST_KEY_RESP 0x09 /* unicast key negotiation response */
39 #define WAI_SUB_UNICAST_KEY_CONFIRM 0x0A /* unicast key negotiation confirmation */
40 #define WAI_SUB_MULTICAST_ANNOUNCE 0x0B /* multicast key/STAKey announcement */
41 #define WAI_SUB_MULTICAST_ANNOUNCE_RESP 0x0C /* multicast key/STAKey announcement response */
43 #define FLAG_BIT0 0x01
44 #define FLAG_BIT1 0x02
45 #define FLAG_BIT2 0x04
46 #define FLAG_BIT3 0x08
47 #define FLAG_BIT4 0x10
48 #define FLAG_BIT5 0x20
49 #define FLAG_BIT6 0x40
50 #define FLAG_BIT7 0x80
52 void proto_register_wai(void);
53 void proto_reg_handoff_wai(void);
55 static reassembly_table wai_reassembly_table
;
57 static dissector_handle_t wai_handle
;
61 static int hf_wai_version
;
62 static int hf_wai_type
;
63 static int hf_wai_subtype
;
64 static int hf_wai_reserved
;
65 static int hf_wai_length
;
66 static int hf_wai_seq
;
67 static int hf_wai_fragm_seq
;
68 static int hf_wai_flag
;
69 static int hf_wai_data
;
70 static int hf_wai_bk_rekeying_flag
;
71 static int hf_wai_preauthentication_flag
;
72 static int hf_wai_certificate_flag
;
73 static int hf_wai_optional_flag
;
74 static int hf_wai_usk_rekeying_flag
;
75 static int hf_wai_negotiation_flag
;
76 static int hf_wai_revoking_flag
;
77 static int hf_wai_reserved_flag
;
78 static int hf_wai_attr_type
;
79 static int hf_wai_cert
;
80 static int hf_wai_cert_id
;
81 static int hf_wai_cert_data
;
82 static int hf_wai_cert_len
;
83 static int hf_wai_addid
;
84 static int hf_wai_ae_mac
;
85 static int hf_wai_asue_mac
;
86 static int hf_wai_bkid
;
87 static int hf_wai_uskid
;
88 static int hf_wai_wie
;
89 static int hf_wai_message_auth_code
;
90 static int hf_wai_mskid
;
91 static int hf_wai_data_pack_num
;
92 static int hf_wai_key_data
;
93 static int hf_wai_key_data_len
;
94 static int hf_wai_key_data_content
;
95 static int hf_wai_key_ann_id
;
96 static int hf_wai_auth_id
;
97 static int hf_wai_identity
;
98 static int hf_wai_identity_id
;
99 static int hf_wai_identity_len
;
100 static int hf_wai_identity_data
;
101 static int hf_wai_ecdh
;
102 static int hf_wai_ecdh_id
;
103 static int hf_wai_ecdh_len
;
104 static int hf_wai_ecdh_content
;
105 static int hf_wai_counter
;
106 static int hf_wai_sta_key_id
;
107 static int hf_wai_challenge
;
108 static int hf_wai_cert_ver
;
109 static int hf_wai_nonce
;
110 static int hf_wai_ver_res
;
111 static int hf_wai_sign_alg
;
112 static int hf_wai_hash_alg_id
;
113 static int hf_wai_sign_alg_id
;
114 static int hf_wai_param
;
115 static int hf_wai_param_id
;
116 static int hf_wai_param_content
;
117 static int hf_wai_sign_val
;
118 static int hf_wai_sign_content
;
119 static int hf_wai_sign
;
120 static int hf_wai_identity_list
;
121 static int hf_wai_reserved_byte
;
122 static int hf_wai_no_of_ids
;
123 static int hf_wai_access_res
;
124 static int hf_wai_fragments
;
125 static int hf_wai_fragment
;
126 static int hf_wai_fragment_overlap
;
127 static int hf_wai_fragment_overlap_conflicts
;
128 static int hf_wai_fragment_multiple_tails
;
129 static int hf_wai_fragment_too_long_fragment
;
130 static int hf_wai_fragment_error
;
131 static int hf_wai_fragment_count
;
132 static int hf_wai_reassembled_in
;
133 static int hf_wai_reassembled_length
;
136 static int ett_wai_data
;
137 static int ett_wai_flags
;
138 static int ett_wai_certificate
;
139 static int ett_wai_mac
;
140 static int ett_wai_identity
;
141 static int ett_wai_key_data
;
142 static int ett_wai_ecdh_param
;
143 static int ett_wai_certificate_verification
;
144 static int ett_wai_identity_list
;
145 static int ett_wai_sign
;
146 static int ett_wai_sign_alg
;
147 static int ett_wai_sign_val
;
148 static int ett_wai_parameter
;
149 static int ett_wai_fragment
;
150 static int ett_wai_fragments
;
152 static const value_string wai_type_names
[] = {
153 { 1, "WAI protocol package"},
157 static const value_string wai_attr_type_names
[] = {
159 { 2, "Certificate Authentication Result"},
160 { 3, "Identity List"},
164 static const value_string wai_ver_res_names
[] = {
165 { 0, "Certificate is valid" },
166 { 1, "Certificate issuer is unknown"},
167 { 2, "Root certificate is untrusted"},
168 { 3, "Certificate time is invalid"},
169 { 4, "Certificate signature is invalid"},
170 { 5, "Certificate is revoked"},
171 { 6, "Certificate is not valid in its proposed usage"},
172 { 7, "Certificate revocation state is unknown"},
173 { 8, "Certificate has an unknown error"},
177 static const value_string wai_access_res_names
[] = {
179 { 1, "Unidentified certificate"},
180 { 2, "Certificate Error"},
181 { 3, "Prohibited by AE"},
185 static const fragment_items wai_frag_items
= {
186 /* Fragment subtrees */
189 /* Fragment fields */
192 &hf_wai_fragment_overlap
,
193 &hf_wai_fragment_overlap_conflicts
,
194 &hf_wai_fragment_multiple_tails
,
195 &hf_wai_fragment_too_long_fragment
,
196 &hf_wai_fragment_error
,
197 &hf_wai_fragment_count
,
198 /* Reassembled in field */
199 &hf_wai_reassembled_in
,
200 /* Reassembled length field */
201 &hf_wai_reassembled_length
,
202 /* Reassembled data field */
208 static const value_string wai_subtype_names
[] = {
209 { WAI_SUB_PRE_AUTHENTICATION
, "Pre-Authentication start" },
210 { WAI_SUB_STAKEY_REQ
, "STAKey request" },
211 { WAI_SUB_AUTH_ACTIVATION
, "Authentication activation" },
212 { WAI_SUB_ACCESS_AUTH_REQ
, "Access authentication request" },
213 { WAI_SUB_ACCESS_AUTH_RESP
, "Access authentication response" },
214 { WAI_SUB_CERT_AUTH_REQ
, "Certificate authentication request" },
215 { WAI_SUB_CERT_AUTH_RESP
, "Certificate authentication response" },
216 { WAI_SUB_UNICAST_KEY_REQ
, "Unicast key negotiation request" },
217 { WAI_SUB_UNICAST_KEY_RESP
, "Unicast key negotiation response" },
218 { WAI_SUB_UNICAST_KEY_CONFIRM
, "Unicast key negotiation confirmation" },
219 { WAI_SUB_MULTICAST_ANNOUNCE
, "Multicast key/STAKey announcement" },
220 { WAI_SUB_MULTICAST_ANNOUNCE_RESP
, "Multicast key/STAKey announcement response" },
223 static value_string_ext wai_subtype_names_ext
= VALUE_STRING_EXT_INIT(wai_subtype_names
);
225 static const true_false_string wai_bk_rekeying_flag
= {
226 "Packet is a BK rekeying packet",
227 "Packet is not a BK rekeying packet"
230 static const true_false_string wai_preauthentication_flag
= {
231 "Packet is a pre-authentication packet",
232 "Packet is not a pre-authentication packet"
235 static const true_false_string wai_certificate_flag
= {
236 "STA requires to verify the peers certificate",
237 "STA doesn't require to verify the peers certificate"
240 static const true_false_string wai_optional_flag
= {
241 "There are some optional fields in packet",
242 "No optional fields in packet"
245 static const true_false_string wai_usk_rekeying_flag
= {
246 "Packet is a USK rekeying packet",
247 "Packet is not a USK rekeying packet"
250 static const true_false_string wai_negotiation_flag
= {
251 "Packet is a STAKey negotiation packet",
252 "Packet is not a STAKey negotiation packet"
255 static const true_false_string wai_revoking_flag
= {
256 "STA delete a STAKey",
257 "STA doesn't delete a STAKey"
260 static const true_false_string wai_reserved_flag
= {
266 dissect_flag(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
268 proto_item
*flag_item
;
269 proto_tree
*flag_tree
;
271 flag_item
= proto_tree_add_item(tree
, hf_wai_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
272 flag_tree
= proto_item_add_subtree (flag_item
, ett_wai_flags
);
274 proto_tree_add_item (flag_tree
, hf_wai_bk_rekeying_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
275 proto_tree_add_item (flag_tree
, hf_wai_preauthentication_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
276 proto_tree_add_item (flag_tree
, hf_wai_certificate_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
277 proto_tree_add_item (flag_tree
, hf_wai_optional_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
278 proto_tree_add_item (flag_tree
, hf_wai_usk_rekeying_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
279 proto_tree_add_item (flag_tree
, hf_wai_negotiation_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
280 proto_tree_add_item (flag_tree
, hf_wai_revoking_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
281 proto_tree_add_item (flag_tree
, hf_wai_reserved_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
285 dissect_bkid(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
287 proto_tree_add_item(tree
, hf_wai_bkid
, tvb
, offset
, 16, ENC_NA
);
291 dissect_uskid(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
293 proto_tree_add_item(tree
, hf_wai_uskid
, tvb
, offset
, 1, ENC_NA
);
296 inline static void dissect_wie(tvbuff_t
*tvb
, unsigned offset
, unsigned length
, proto_tree
*tree
)
298 proto_tree_add_item(tree
, hf_wai_wie
, tvb
, offset
, length
, ENC_NA
);
302 dissect_message_auth_code(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
304 proto_tree_add_item(tree
, hf_wai_message_auth_code
, tvb
, offset
, 20, ENC_NA
);
308 dissect_mskid(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
310 proto_tree_add_item(tree
, hf_wai_mskid
, tvb
, offset
, 1, ENC_NA
);
314 dissect_key_announcement_identifier(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
316 proto_tree_add_item(tree
, hf_wai_key_ann_id
, tvb
, offset
, 16, ENC_NA
);
320 dissect_counter(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
322 proto_tree_add_item(tree
, hf_wai_counter
, tvb
, offset
, 16, ENC_NA
);
326 dissect_authentication_id(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
328 proto_tree_add_item(tree
, hf_wai_auth_id
, tvb
, offset
, 32, ENC_NA
);
332 dissect_addid(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
334 proto_item
*mac_item
;
335 proto_tree
*mac_tree
;
337 mac_item
= proto_tree_add_string(tree
, hf_wai_addid
, tvb
, offset
, 12, "AE MAC and ASUE MAC addresses");
339 mac_tree
= proto_item_add_subtree(mac_item
, ett_wai_mac
);
340 proto_tree_add_item(mac_tree
, hf_wai_ae_mac
, tvb
, offset
, 6, ENC_NA
);
341 proto_tree_add_item(mac_tree
, hf_wai_asue_mac
, tvb
, offset
+6, 6, ENC_NA
);
345 dissect_identity(tvbuff_t
* tvb
, const uint16_t offset
, proto_tree
* tree
,
346 const char * const label
)
352 length
= tvb_get_ntohs(tvb
, offset
+2);
354 id_item
= proto_tree_add_item(tree
, hf_wai_identity
, tvb
, offset
, length
+4, ENC_NA
);
355 id_tree
= proto_item_add_subtree(id_item
, ett_wai_identity
);
356 proto_item_set_text(id_item
, "%sIdentity", ((label
==NULL
)?"":label
));
357 proto_tree_add_item(id_tree
, hf_wai_identity_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
358 proto_tree_add_item(id_tree
, hf_wai_identity_len
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
359 proto_tree_add_item(id_tree
, hf_wai_identity_data
, tvb
, offset
+4, length
, ENC_NA
);
365 dissect_certificate(tvbuff_t
* tvb
, const int offset
, proto_tree
* tree
,
366 const char * const label
)
368 proto_item
*certificate_item
;
369 proto_tree
*certificate_tree
;
373 const char *id_name
= "unknown";
375 id
= tvb_get_ntohs(tvb
, offset
);
378 id_name
= "X.509 v3";
383 length
= tvb_get_ntohs(tvb
, offset
+2);
385 certificate_item
= proto_tree_add_item(tree
, hf_wai_cert
, tvb
, offset
, length
+4, ENC_NA
);
386 proto_item_set_text(certificate_item
, "%sCertificate", ((label
==NULL
)?"":label
));
387 certificate_tree
= proto_item_add_subtree(certificate_item
, ett_wai_certificate
);
389 id_item
= proto_tree_add_item(certificate_tree
, hf_wai_cert_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
390 proto_item_set_text(id_item
, "Certificate Identifier: %s (%#x)", id_name
, id
);
391 proto_tree_add_item(certificate_tree
, hf_wai_cert_len
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
392 proto_tree_add_item(certificate_tree
, hf_wai_cert_data
, tvb
, offset
+4, length
, ENC_NA
);
398 dissect_ecdh_parameter(tvbuff_t
* tvb
, const int offset
, proto_tree
* tree
)
400 proto_item
*ecdh_item
;
401 proto_tree
*ecdh_tree
;
402 proto_item
*ecdh_id_item
;
405 const char *id_name
= "unknown";
407 ecdh_id
= tvb_get_uint8(tvb
, offset
);
411 } else if (ecdh_id
== 2) {
412 id_name
= "Detailed parameter";
415 ecdh_len
= tvb_get_ntohs(tvb
, offset
+1);
417 ecdh_item
= proto_tree_add_item(tree
, hf_wai_ecdh
, tvb
, offset
, ecdh_len
+3, ENC_NA
);
418 ecdh_tree
= proto_item_add_subtree(ecdh_item
, ett_wai_ecdh_param
);
419 ecdh_id_item
= proto_tree_add_item(ecdh_tree
, hf_wai_ecdh_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
420 proto_item_set_text(ecdh_id_item
, "ID: %s (%#x)", id_name
, ecdh_id
);
421 proto_tree_add_item(ecdh_tree
, hf_wai_ecdh_len
, tvb
, offset
+1, 2, ENC_BIG_ENDIAN
);
422 proto_tree_add_item(ecdh_tree
, hf_wai_ecdh_content
, tvb
, offset
+3, ecdh_len
, ENC_NA
);
428 dissect_challenge(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
, const char * const label
)
430 proto_item
*challenge_item
;
431 const uint16_t challenge_length
= 32;
433 challenge_item
= proto_tree_add_item(tree
, hf_wai_challenge
, tvb
, offset
, 32, ENC_NA
);
434 proto_item_append_text(challenge_item
, "(%schallenge)", ((label
==NULL
)?"":label
));
436 return challenge_length
;
440 dissect_key_data(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
, const char *const label
)
442 proto_item
*key_data_item
;
443 proto_tree
*key_data_tree
;
446 length
= tvb_get_uint8(tvb
, offset
);
448 key_data_item
= proto_tree_add_item(tree
, hf_wai_key_data
, tvb
, offset
, length
+1, ENC_NA
);
449 proto_item_set_text(key_data_item
, "%sKey Data", ((label
==NULL
)?"":label
));
450 key_data_tree
= proto_item_add_subtree(key_data_item
, ett_wai_key_data
);
451 proto_tree_add_item(key_data_tree
, hf_wai_key_data_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
454 proto_tree_add_item(key_data_tree
, hf_wai_key_data_content
, tvb
, offset
+1, length
, ENC_NA
);
461 dissect_multiple_certificate(tvbuff_t
* tvb
, unsigned offset
, proto_tree
*tree
)
463 proto_item
*multicert_item
;
464 proto_tree
*multicert_tree
;
465 proto_item
*nonce_1_item
;
466 proto_item
*nonce_2_item
;
469 length
= tvb_get_ntohs(tvb
, offset
+1);
470 multicert_item
= proto_tree_add_item(tree
, hf_wai_cert_ver
, tvb
, offset
, length
+3, ENC_NA
);
471 multicert_tree
= proto_item_add_subtree(multicert_item
, ett_wai_certificate_verification
);
472 proto_tree_add_item(multicert_tree
, hf_wai_attr_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
474 proto_tree_add_item(multicert_tree
, hf_wai_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
476 nonce_1_item
= proto_tree_add_item(multicert_tree
, hf_wai_nonce
, tvb
, offset
, 32, ENC_NA
);
478 proto_item_append_text(nonce_1_item
, " 1");
479 nonce_2_item
= proto_tree_add_item(multicert_tree
, hf_wai_nonce
, tvb
, offset
, 32, ENC_NA
);
481 proto_item_append_text(nonce_2_item
, " 2");
482 proto_tree_add_item(multicert_tree
, hf_wai_ver_res
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
484 offset
+= dissect_certificate(tvb
, offset
, multicert_tree
, "1 ");
485 proto_tree_add_item(multicert_tree
, hf_wai_ver_res
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
487 dissect_certificate(tvb
, offset
, multicert_tree
, "2 ");
493 dissect_identity_list(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
495 proto_item
*id_list_item
;
496 proto_tree
*id_list_tree
;
501 length
= tvb_get_ntohs(tvb
, offset
+1);
502 id_list_item
= proto_tree_add_item(tree
, hf_wai_identity_list
, tvb
, offset
, length
+3, ENC_NA
);
503 id_list_tree
= proto_item_add_subtree(id_list_item
, ett_wai_identity_list
);
504 proto_tree_add_item(id_list_tree
, hf_wai_attr_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
506 proto_tree_add_item(id_list_tree
, hf_wai_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
508 proto_tree_add_item(id_list_tree
, hf_wai_reserved_byte
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
510 proto_tree_add_item(id_list_tree
, hf_wai_no_of_ids
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
511 no_of_ids
= tvb_get_ntohs(tvb
, offset
);
514 for(i
=0; i
< no_of_ids
; i
++) {
515 char number
[6] = {0};
517 snprintf(number
, 6, "%d", i
);
518 offset
+= dissect_identity(tvb
, offset
, id_list_tree
, number
);
525 dissect_signature_algorithm(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
529 proto_item
*param_item
;
530 proto_tree
*param_tree
;
531 proto_item
*alg_name_item
;
532 proto_item
*sig_name_item
;
538 length
= tvb_get_ntohs(tvb
, offset
);
540 sa_item
= proto_tree_add_item(tree
, hf_wai_sign_alg
, tvb
, offset
, length
+2, ENC_NA
);
541 sa_tree
= proto_item_add_subtree(sa_item
, ett_wai_sign_alg
);
543 proto_tree_add_item(sa_tree
, hf_wai_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
546 alg_name_item
= proto_tree_add_item(sa_tree
, hf_wai_hash_alg_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
547 alg_id
= tvb_get_uint8(tvb
, offset
);
550 proto_item_set_text(alg_name_item
, "Algorithm Identifier: SHA-256 (0x01)");
554 sig_name_item
= proto_tree_add_item(sa_tree
, hf_wai_sign_alg_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
555 sig_id
= tvb_get_uint8(tvb
, offset
);
558 proto_item_set_text(sig_name_item
, "Signature Algorithm Identifier: ECDSA-192 (0x01)");
562 param_len
= tvb_get_ntohs(tvb
, offset
+1);
563 param_item
= proto_tree_add_item(sa_tree
, hf_wai_param
, tvb
, offset
, param_len
+3, ENC_NA
);
564 param_tree
= proto_item_add_subtree(param_item
, ett_wai_parameter
);
565 proto_tree_add_item(param_tree
, hf_wai_param_id
, tvb
, offset
, 1, ENC_NA
);
567 proto_tree_add_item(param_tree
, hf_wai_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
569 proto_tree_add_item(param_tree
, hf_wai_param_content
, tvb
, offset
, param_len
, ENC_NA
);
575 dissect_signature_value(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
)
581 length
= tvb_get_ntohs(tvb
, offset
);
583 sv_item
= proto_tree_add_item(tree
, hf_wai_sign_val
, tvb
, offset
, length
+2, ENC_NA
);
584 sv_tree
= proto_item_add_subtree(sv_item
, ett_wai_sign_val
);
586 proto_tree_add_item(sv_tree
, hf_wai_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
589 proto_tree_add_item(sv_tree
, hf_wai_sign_content
, tvb
, offset
, length
, ENC_NA
);
595 dissect_signature(tvbuff_t
*tvb
, unsigned offset
, proto_tree
*tree
, const char *const label
)
601 length
= tvb_get_ntohs(tvb
, offset
+1);
603 ss_item
= proto_tree_add_item(tree
, hf_wai_sign
, tvb
, offset
, length
+3, ENC_NA
);
604 proto_item_set_text(ss_item
, "%s", (label
==NULL
)?"Signature":label
);
605 ss_tree
= proto_item_add_subtree(ss_item
, ett_wai_sign
);
607 proto_tree_add_item(ss_tree
, hf_wai_attr_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
610 proto_tree_add_item(ss_tree
, hf_wai_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
613 offset
+= dissect_identity(tvb
, offset
, ss_tree
, NULL
);
614 offset
+= dissect_signature_algorithm(tvb
, offset
, ss_tree
);
615 dissect_signature_value(tvb
, offset
, ss_tree
);
622 dissect_wai_data(tvbuff_t
*tvb
, proto_tree
*tree
, uint8_t subtype
, uint16_t lenx
)
624 proto_item
*data_item
;
625 proto_tree
*data_tree
;
626 const char *type_name
;
628 data_item
= proto_tree_add_item(tree
, hf_wai_data
, tvb
, 0, lenx
, ENC_NA
);
629 data_tree
= proto_item_add_subtree (data_item
, ett_wai_data
);
631 type_name
= val_to_str_ext_const(subtype
, &wai_subtype_names_ext
, "Unknown type");
633 proto_item_set_text(data_item
, "%s data (%d bytes)", type_name
, lenx
);
636 case WAI_SUB_PRE_AUTHENTICATION
:
638 /* Chapter 8.1.4.6 Preauthentication [ref: 1] */
639 dissect_flag(tvb
, 0, data_tree
);
640 dissect_uskid(tvb
, 1, data_tree
);
641 dissect_addid(tvb
, 2, data_tree
);
642 dissect_counter(tvb
, 14, data_tree
);
643 dissect_message_auth_code(tvb
, 30, data_tree
);
646 case WAI_SUB_STAKEY_REQ
:
648 /* Chapter 8.1.4.5 STAKey Establishment procedure [ref: 1] */
649 dissect_flag(tvb
, 0, data_tree
);
650 proto_tree_add_item(data_tree
, hf_wai_sta_key_id
, tvb
, 1, 1, ENC_BIG_ENDIAN
);
651 dissect_uskid(tvb
, 2, data_tree
);
652 dissect_addid(tvb
, 3, data_tree
);
653 dissect_counter(tvb
, 15, data_tree
);
654 dissect_message_auth_code(tvb
, 31, data_tree
);
657 case WAI_SUB_AUTH_ACTIVATION
:
659 /* Chapter 8.1.4.2.1 WAI Authentication Activation [ref: 1] */
662 dissect_flag(tvb
, offset
, data_tree
);
664 dissect_authentication_id(tvb
, offset
, data_tree
);
666 offset
+= dissect_identity(tvb
, offset
, data_tree
, "Local ASU ");
667 offset
+= dissect_certificate(tvb
, offset
, data_tree
, "STE AE ");
668 dissect_ecdh_parameter(tvb
, offset
, data_tree
);
671 case WAI_SUB_ACCESS_AUTH_REQ
:
673 /* Chapter 8.1.4.2.2 Access WAI Authentication Request [ref: 1] */
675 uint8_t optional_field
;
677 optional_field
= tvb_get_uint8(tvb
, 0) & FLAG_BIT3
;
679 dissect_flag(tvb
, offset
, data_tree
);
681 dissect_authentication_id(tvb
, offset
, data_tree
);
683 offset
+= dissect_challenge(tvb
, offset
, data_tree
, "ASUE ");
684 offset
+= dissect_key_data(tvb
, offset
, data_tree
, "ASUE ");
685 offset
+= dissect_identity(tvb
, offset
, data_tree
, "STA AE ");
686 offset
+= dissect_certificate(tvb
, offset
, data_tree
, "STA ASUE ");
687 offset
+= dissect_ecdh_parameter(tvb
, offset
, data_tree
);
689 if (optional_field
) {
690 offset
+= dissect_identity_list(tvb
, offset
, data_tree
);
693 dissect_signature(tvb
, offset
, data_tree
, "ASUE Signature");
696 case WAI_SUB_ACCESS_AUTH_RESP
:
698 /* Chapter 8.1.4.2.5 Access WAI Authentication Response [ref: 1] */
700 uint8_t optional_field
;
702 optional_field
= tvb_get_uint8(tvb
, 0) & FLAG_BIT3
;
704 dissect_flag(tvb
, offset
, data_tree
);
706 offset
+= dissect_challenge(tvb
, offset
, data_tree
, "ASUE ");
707 offset
+= dissect_challenge(tvb
, offset
, data_tree
, "AE ");
708 proto_tree_add_item(data_tree
, hf_wai_access_res
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
710 offset
+= dissect_key_data(tvb
, offset
, data_tree
, "ASUE ");
711 offset
+= dissect_key_data(tvb
, offset
, data_tree
, "AE ");
712 offset
+= dissect_identity(tvb
, offset
, data_tree
, "STA AE ");
713 offset
+= dissect_identity(tvb
, offset
, data_tree
, "STA ASUE ");
715 if (optional_field
) {
717 offset
+= dissect_multiple_certificate(tvb
, offset
, data_tree
);
718 offset
+= dissect_signature(tvb
, offset
, data_tree
, "Server Signature trusted by ASUE");
719 length
= tvb_get_ntohs(tvb
, offset
+1);
720 if (length
+ 3 + offset
+ 1 < lenx
)
721 offset
+= dissect_signature(tvb
, offset
, data_tree
, "Server Signature trusted by AE");
724 dissect_signature(tvb
, offset
, data_tree
, "AE Signature");
727 case WAI_SUB_CERT_AUTH_REQ
:
729 /* Chapter 8.1.4.2.3 Certificate Authentication Request [ref: 1] */
731 uint8_t optional_field
;
733 optional_field
= tvb_get_uint8(tvb
, 0) & FLAG_BIT3
;
735 dissect_addid(tvb
, offset
, data_tree
);
737 offset
+= dissect_challenge(tvb
, offset
, data_tree
, "AE ");
738 offset
+= dissect_challenge(tvb
, offset
, data_tree
, "ASUE ");
739 offset
+= dissect_certificate(tvb
, offset
, data_tree
, "STE ASUE ");
740 offset
+= dissect_certificate(tvb
, offset
, data_tree
, "STE AE ");
741 if (optional_field
) {
742 dissect_identity_list(tvb
, offset
, data_tree
);
746 case WAI_SUB_CERT_AUTH_RESP
:
748 /* Chapter 8.1.4.2.4 Certificate Authentication Response [ref: 1] */
751 dissect_addid(tvb
, offset
, data_tree
);
753 offset
+= dissect_multiple_certificate(tvb
, offset
, data_tree
);
754 offset
+= dissect_signature(tvb
, offset
, data_tree
, "Server Signature trusted by ASUE");
756 dissect_signature(tvb
, offset
, data_tree
, "Server Signature trusted by AE");
759 case WAI_SUB_UNICAST_KEY_REQ
:
761 /* Chapter 8.1.4.3.1 Unicast Key Negotiation Request [ref: 1] */
762 dissect_flag(tvb
, 0, data_tree
);
763 dissect_bkid(tvb
, 1, data_tree
);
764 dissect_uskid(tvb
, 17, data_tree
);
765 dissect_addid(tvb
, 18, data_tree
);
766 dissect_challenge(tvb
, 30, data_tree
, "AE ");
769 case WAI_SUB_UNICAST_KEY_RESP
:
771 /* Chapter 8.1.4.3.2 Unicast Key Negotiation Response [ref: 1] */
775 dissect_flag(tvb
, 0, data_tree
);
776 dissect_bkid(tvb
, 1, data_tree
);
777 dissect_uskid(tvb
, 17, data_tree
);
778 dissect_addid(tvb
, 18, data_tree
);
779 dissect_challenge(tvb
, 30, data_tree
, "ASUE ");
780 dissect_challenge(tvb
, 62, data_tree
, "AE ");
782 next_tvb
= tvb_new_subset_remaining(tvb
, 96);
783 length
= tvb_reported_length(next_tvb
);
785 dissect_wie(next_tvb
, 0, length
-20, data_tree
);
786 dissect_message_auth_code(next_tvb
, length
-20, data_tree
);
789 case WAI_SUB_UNICAST_KEY_CONFIRM
:
791 /* Chapter 8.1.4.3.3 Unicast Key Negotiation Confirmation [ref: 1] */
795 dissect_flag(tvb
, 0, data_tree
);
796 dissect_bkid(tvb
, 1, data_tree
);
797 dissect_uskid(tvb
, 17, data_tree
);
798 dissect_addid(tvb
, 18, data_tree
);
799 dissect_challenge(tvb
, 30, data_tree
, "ASUE ");
801 next_tvb
= tvb_new_subset_remaining(tvb
, 62);
802 length
= tvb_reported_length(next_tvb
);
804 dissect_wie(next_tvb
, 0, length
-20, data_tree
);
805 dissect_message_auth_code(next_tvb
, length
-20, data_tree
);
808 case WAI_SUB_MULTICAST_ANNOUNCE
:
810 /* Chapter 8.1.4.4.1 Multicast Key/STAKey Announcement [ref: 1] */
813 dissect_flag(tvb
, offset
, data_tree
);
815 dissect_mskid(tvb
, offset
, data_tree
);
817 dissect_uskid(tvb
, offset
, data_tree
);
819 dissect_addid(tvb
, offset
, data_tree
);
821 proto_tree_add_item(data_tree
, hf_wai_data_pack_num
, tvb
, offset
, 16, ENC_NA
);
823 dissect_key_announcement_identifier(tvb
, offset
, data_tree
);
825 offset
+= dissect_key_data(tvb
, offset
, data_tree
, NULL
);
826 dissect_message_auth_code(tvb
, offset
, data_tree
);
829 case WAI_SUB_MULTICAST_ANNOUNCE_RESP
:
831 /* Chapter 8.1.4.4.2 Multicast Key/STAKey Announcement Response [ref: 1] */
832 dissect_flag(tvb
, 0, data_tree
);
833 dissect_mskid(tvb
, 1, data_tree
);
834 dissect_uskid(tvb
, 2, data_tree
);
835 dissect_addid(tvb
, 3, data_tree
);
836 dissect_key_announcement_identifier(tvb
, 15, data_tree
);
837 dissect_message_auth_code(tvb
, 31, data_tree
);
846 dissect_wai(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
848 /* Format of WAPI protocol packet in WAI authentication system
851 -------------------------------------------------------------------------------
852 | Ver. | Type | Subtype | Reserved | Length | packet | fragm. | flag | data |
853 | | seq. no | seq. no | |
854 |-----------------------------------------------------------------------------|
855 Figure 18 from [ref:1]
857 #define WAI_MESSAGE_LENGTH 12 /*Length of all fields without 'Data' field*/
858 #define WAI_DATA_OFFSET WAI_MESSAGE_LENGTH
863 uint8_t fragment_num
;
865 fragment_head
*frag_msg
;
866 proto_tree
*wai_tree
= NULL
;
869 const char *subtype_name
= "Unknown type";
871 length
= tvb_get_ntohs(tvb
, 6)-WAI_MESSAGE_LENGTH
;
872 subtype
= tvb_get_uint8(tvb
, 3);
874 /* quick sanity check */
875 if ((length
!= tvb_reported_length (tvb
)-WAI_MESSAGE_LENGTH
) ||
876 (subtype
> WAI_SUB_MULTICAST_ANNOUNCE_RESP
)) {
880 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "WAI");
881 col_clear(pinfo
->cinfo
, COL_INFO
);
882 version
= tvb_get_ntohs(tvb
, 0);
885 subtype_name
= val_to_str_ext_const(subtype
, &wai_subtype_names_ext
, "Unknown type");
887 col_append_str(pinfo
->cinfo
, COL_INFO
, subtype_name
);
889 /* Field lengths and offsets in WAI protocol described above */
890 packet_num
= tvb_get_ntohs(tvb
, 8);
891 fragment_num
= tvb_get_uint8(tvb
, 10);
892 flags
= tvb_get_uint8(tvb
, 11);
895 proto_item
*wai_item
;
897 wai_item
= proto_tree_add_item(tree
, proto_wai
, tvb
, 0, -1, ENC_NA
);
899 proto_item_set_text (wai_item
, "WAI Protocol (%s)",
900 val_to_str_ext_const(subtype
, &wai_subtype_names_ext
, "Unknown type"));
901 wai_tree
= proto_item_add_subtree(wai_item
, ett_wai
);
903 /* Field lengths and offsets in WAI protocol described above */
904 proto_tree_add_item(wai_tree
, hf_wai_version
, tvb
, 0, 2, ENC_BIG_ENDIAN
);
905 proto_tree_add_item(wai_tree
, hf_wai_type
, tvb
, 2, 1, ENC_BIG_ENDIAN
);
906 proto_tree_add_item(wai_tree
, hf_wai_subtype
, tvb
, 3, 1, ENC_BIG_ENDIAN
);
907 proto_tree_add_item(wai_tree
, hf_wai_reserved
, tvb
, 4, 2, ENC_BIG_ENDIAN
);
908 proto_tree_add_item(wai_tree
, hf_wai_length
, tvb
, 6, 2, ENC_BIG_ENDIAN
);
909 proto_tree_add_item(wai_tree
, hf_wai_seq
, tvb
, 8, 2, ENC_BIG_ENDIAN
);
910 proto_tree_add_item(wai_tree
, hf_wai_fragm_seq
, tvb
, 10, 1, ENC_BIG_ENDIAN
);
911 proto_tree_add_item(wai_tree
, hf_wai_flag
, tvb
, 11, 1, ENC_BIG_ENDIAN
);
914 frag_msg
= fragment_add_seq_check (&wai_reassembly_table
,
915 tvb
, WAI_DATA_OFFSET
,
923 next_tvb
= tvb_new_subset_remaining(tvb
, WAI_DATA_OFFSET
);
925 /* Replace INFO column if message is fragmented and call data dissector */
927 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
928 "Fragment (%d) of message, data not dissected", fragment_num
);
930 process_reassembled_data(tvb
, WAI_DATA_OFFSET
, pinfo
,
931 "Reassembled WAI", frag_msg
, &wai_frag_items
,
934 call_data_dissector(next_tvb
, pinfo
, tree
);
936 /* If this is the last fragment of fragmented message, then reassamble and dissect
937 otherwise only dissect */
938 if (fragment_num
> 0) {
939 new_tvb
= process_reassembled_data(tvb
, WAI_DATA_OFFSET
, pinfo
,
940 "Reassembled WAI", frag_msg
, &wai_frag_items
,
944 col_set_str(pinfo
->cinfo
, COL_INFO
, "Last fragment of message, data dissected");
945 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ", subtype_name
);
947 length
= tvb_reported_length (next_tvb
);
950 /* dissect Data field of WAI packet */
952 dissect_wai_data(next_tvb
, wai_tree
, subtype
, length
);
956 return tvb_captured_length(tvb
);
960 proto_register_wai(void)
962 static hf_register_info hf
[] = {
964 { "Version", "wai.version",
965 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
966 "Version of authentication infrastructure", HFILL
}},
969 { "Type", "wai.type",
970 FT_UINT8
, BASE_HEX
, VALS(wai_type_names
), 0x0,
971 "Protocol type", HFILL
}},
974 { "Subtype", "wai.subtype",
975 FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &wai_subtype_names_ext
, 0x0,
979 { "Reserved", "wai.reserved",
980 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
984 { "Length", "wai.length",
985 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
989 { "Sequence number", "wai.seq",
990 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
991 "Packet sequence number", HFILL
}},
994 { "Fragment sequence number", "wai.fragm.seq",
995 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
999 { "Flag", "wai.flag",
1000 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1004 { "Data", "wai.data",
1005 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1008 { &hf_wai_bk_rekeying_flag
,
1009 {"BK rekeying", "wai.bk.rekeying.flag",
1010 FT_BOOLEAN
, 8, TFS (&wai_bk_rekeying_flag
), FLAG_BIT0
,
1011 "BK rekeying flag", HFILL
}},
1013 { &hf_wai_preauthentication_flag
,
1014 {"Pre-Authentication", "wai.preauthentication.flag",
1015 FT_BOOLEAN
, 8, TFS (&wai_preauthentication_flag
), FLAG_BIT1
,
1016 "Pre-Authentication flag", HFILL
}},
1018 { &hf_wai_certificate_flag
,
1019 {"Certificate", "wai.certificate.flag",
1020 FT_BOOLEAN
, 8, TFS (&wai_certificate_flag
), FLAG_BIT2
,
1021 "Certificate flag", HFILL
}},
1023 { &hf_wai_optional_flag
,
1024 {"Optional", "wai.optional.flag",
1025 FT_BOOLEAN
, 8, TFS (&wai_optional_flag
), FLAG_BIT3
,
1026 "Optional flag", HFILL
}},
1028 { &hf_wai_usk_rekeying_flag
,
1029 {"USK rekeying", "wai.usk.rekeying.flag",
1030 FT_BOOLEAN
, 8, TFS (&wai_usk_rekeying_flag
), FLAG_BIT4
,
1031 "USK rekeying flag", HFILL
}},
1033 { &hf_wai_negotiation_flag
,
1034 {"STA negotiation", "wai.negotiation.flag",
1035 FT_BOOLEAN
, 8, TFS (&wai_negotiation_flag
), FLAG_BIT5
,
1036 "STA negotiation flag", HFILL
}},
1038 { &hf_wai_revoking_flag
,
1039 {"STA revoking", "wai.revoking.flag",
1040 FT_BOOLEAN
, 8, TFS (&wai_revoking_flag
), FLAG_BIT6
,
1041 "STA revoking flag", HFILL
}},
1043 { &hf_wai_reserved_flag
,
1044 {"Reserved", "wai.reserved.flag",
1045 FT_BOOLEAN
, 8, TFS (&wai_reserved_flag
), FLAG_BIT7
,
1046 "Reserved flag", HFILL
}},
1048 { &hf_wai_attr_type
,
1049 { "Type", "wai.attrtype",
1050 FT_UINT8
, BASE_HEX
, VALS(wai_attr_type_names
), 0x0,
1051 "Attribute type", HFILL
}},
1054 {"Certificate", "wai.cert",
1055 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1059 {"Id", "wai.cert.id",
1060 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1061 "Certificate Id", HFILL
}},
1063 { &hf_wai_cert_data
,
1064 {"Data", "wai.cert.data",
1065 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1066 "Certificate data", HFILL
}},
1069 {"Length", "wai.cert.len",
1070 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1071 "Certificate length", HFILL
}},
1074 {"ADDID", "wai.addid",
1075 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1079 {"AE MAC", "wai.ae.mac",
1080 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1081 "AE MAC address", HFILL
}},
1084 {"ASUE MAC", "wai.asue.mac",
1085 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1086 "ASUE MAC address", HFILL
}},
1089 {"BKID", "wai.bkid",
1090 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1094 {"USKID", "wai.uskid",
1095 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1099 {"WIE from ASUE", "wai.wie",
1100 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1103 { &hf_wai_message_auth_code
,
1104 {"Message Authentication Code", "wai.message.auth.code",
1105 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1109 {"MSKID/STAKeyID", "wai.mskid",
1110 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1113 { &hf_wai_data_pack_num
,
1114 {"Data packet number", "wai.data.packet.num",
1115 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1119 {"Key Data", "wai.key.data",
1120 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1123 { &hf_wai_key_data_len
,
1124 {"Length", "wai.key.data.len",
1125 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1126 "Key data length", HFILL
}},
1128 { &hf_wai_key_data_content
,
1129 {"Content", "wai.key.data.content",
1130 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1131 "Key data content", HFILL
}},
1133 { &hf_wai_key_ann_id
,
1134 {"Key Announcement Identifier", "wai.key.ann.id",
1135 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1139 {"Authentication Identifier", "wai.auth.id",
1140 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1144 {"Identifier", "wai.identity",
1145 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1148 { &hf_wai_identity_id
,
1149 {"Id", "wai.identity.id",
1150 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1153 { &hf_wai_identity_len
,
1154 {"Length", "wai.identity.len",
1155 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1156 "Identity length", HFILL
}},
1158 { &hf_wai_identity_data
,
1159 {"Data", "wai.identity.data",
1160 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1161 "Identity data", HFILL
}},
1164 {"ECDH Parameter", "wai.ecdhp",
1165 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1169 {"ID", "wai.edch.id",
1170 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1171 "ECDH Parameter Identifier", HFILL
}},
1174 {"Length", "wai.ecdh.len",
1175 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1176 "ECDH Parameter Length", HFILL
}},
1178 { &hf_wai_ecdh_content
,
1179 {"Content", "wai.ecdh.content",
1180 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1181 "ECDH Parameter Content", HFILL
}},
1184 {"Replay counter", "wai.counter",
1185 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1188 { &hf_wai_sta_key_id
,
1189 {"STAKeyID", "wai.sta.key.id",
1190 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1193 { &hf_wai_challenge
,
1194 {"Challenge", "wai.challenge",
1195 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1199 {"Multiple Certificate Verification Result", "wai.cert.ver",
1200 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1204 {"Nonce", "wai.nonce",
1205 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1209 {"Verification result", "wai.ver.res",
1210 FT_UINT8
, BASE_HEX
, VALS(wai_ver_res_names
), 0x0,
1214 {"Signature Algorithm", "wai.sign.alg",
1215 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1218 { &hf_wai_hash_alg_id
,
1219 {"Hash Algorithm Identifier", "wai.hash.alg.id",
1220 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1223 { &hf_wai_sign_alg_id
,
1224 {"Signature Algorithm Identifier", "wai.sign.alg.id",
1225 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1229 {"Parameter", "wai.param",
1230 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1234 {"Parameter Identifier", "wai.param.id",
1235 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1238 { &hf_wai_param_content
,
1239 {"Parameter Content", "wai.param.content",
1240 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1244 {"Signature Value", "wai.sign.val",
1245 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1248 { &hf_wai_sign_content
,
1249 {"Signature Content", "wai.sign.content",
1250 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1254 {"Signature", "wai.sign",
1255 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1258 { &hf_wai_identity_list
,
1259 {"ASU List trusted by ASUE", "wai.identity_list",
1260 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1261 "Identity list", HFILL
}},
1263 { &hf_wai_reserved_byte
,
1264 {"Reserved", "wai.reserved.byte",
1265 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1268 { &hf_wai_no_of_ids
,
1269 {"Number of Identities", "wai.no.of.ids",
1270 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1273 { &hf_wai_access_res
,
1274 {"Access result", "wai.access_result",
1275 FT_UINT8
, BASE_HEX
, VALS(wai_access_res_names
), 0x0,
1278 { &hf_wai_fragments
,
1279 {"Message fragments", "wai.fragments",
1280 FT_NONE
, BASE_NONE
, NULL
, 0x00,
1284 {"Message fragment", "wai.fragment",
1285 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x00,
1288 { &hf_wai_fragment_overlap
,
1289 {"Message fragment overlap", "wai.fragment.overlap",
1290 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
1293 { &hf_wai_fragment_overlap_conflicts
,
1294 {"Message fragment overlapping with conflicting data", "wai.fragment.overlap.conflicts",
1295 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
1298 { &hf_wai_fragment_multiple_tails
,
1299 {"Message has multiple tail fragments", "wai.fragment.multiple_tails",
1300 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
1303 { &hf_wai_fragment_too_long_fragment
,
1304 {"Message fragment too long", "wai.fragment.too_long_fragment",
1305 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
1308 { &hf_wai_fragment_error
,
1309 {"Message defragmentation error", "wai.fragment.error",
1310 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x00,
1313 { &hf_wai_fragment_count
,
1314 {"Message fragment count", "wai.fragment.count",
1315 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
1318 { &hf_wai_reassembled_in
,
1319 {"Reassembled in", "wai.reassembled.in",
1320 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x00,
1323 { &hf_wai_reassembled_length
,
1324 {"Reassembled length", "wai.reassembled.length",
1325 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
1329 static int *ett
[] = {
1333 &ett_wai_certificate
,
1337 &ett_wai_ecdh_param
,
1338 &ett_wai_certificate_verification
,
1339 &ett_wai_identity_list
,
1348 proto_wai
= proto_register_protocol("WAI Protocol", "WAI", "wai");
1349 proto_register_field_array(proto_wai
, hf
, array_length(hf
));
1350 proto_register_subtree_array(ett
, array_length(ett
));
1351 reassembly_table_register(&wai_reassembly_table
,
1352 &addresses_reassembly_table_functions
);
1354 wai_handle
= register_dissector("wai", dissect_wai
, proto_wai
);
1358 proto_reg_handoff_wai(void)
1360 dissector_add_uint("ethertype", ETHERTYPE_WAI
, wai_handle
);
1364 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1369 * indent-tabs-mode: nil
1372 * vi: set shiftwidth=4 tabstop=8 expandtab:
1373 * :indentSize=4:tabSize=8:noTabs=true: