epan/dissectors/pidl/ C99 drsuapi
[wireshark-sm.git] / epan / dissectors / packet-teap.c
blobcefae82f04f63c97d430e74b1c7a7b13d8964769
1 /* packet-teap.c
2 * Routines for TEAP (Tunnel Extensible Authentication Protocol)
3 * RFC 7170
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "config.h"
14 #include <epan/packet.h>
15 #include <epan/expert.h>
16 #include <epan/proto_data.h>
18 void proto_register_teap(void);
19 void proto_reg_handoff_teap(void);
21 static int proto_teap;
23 static int ett_teap;
24 static int ett_teap_tlv;
25 static int ett_pac_attr_tlv;
27 static expert_field ei_teap_bad_length;
29 static dissector_handle_t teap_handle;
31 static dissector_handle_t eap_handle;
34 From RFC7170, pg 27
36 0 1 2 3
37 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
38 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
39 |M|R| TLV Type | Length |
40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 | Value...
42 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 #define TEAP_TLV_MANDATORY 0x8000
46 #define TEAP_TLV_RESERVED 0x4000
47 #define TEAP_TLV_TYPE 0x3FFF
49 #define TEAP_CRYPTO_FLAGS 0xF0
50 #define TEAP_CRYPTO_SUBTYPE 0x0F
52 #define TEAP_UNASSIGNED 0
53 #define TEAP_AUTHORITY_ID 1
54 #define TEAP_IDENTITY 2
55 #define TEAP_RESULT 3
56 #define TEAP_NAK 4
57 #define TEAP_ERROR 5
58 #define TEAP_CHANNEL_BINDING 6
59 #define TEAP_VENDOR_SPECIFIC 7
60 #define TEAP_REQUEST_ACTION 8
61 #define TEAP_EAP_PAYLOAD 9
62 #define TEAP_INTERMEDIATE_RESULT 10
63 #define TEAP_PAC 11
64 #define TEAP_CRYPTO_BINDING 12
65 #define TEAP_BASIC_PWD_AUTH_REQUEST 13
66 #define TEAP_BASIC_PWD_AUTH_RESPONSE 14
67 #define TEAP_PKCS7 15
68 #define TEAP_PKCS10 16
69 #define TEAP_TRUSTED_SERVER_ROOT 17
71 static const value_string teap_tlv_type_vals[] = {
72 { TEAP_UNASSIGNED, "Unassigned" },
73 { TEAP_AUTHORITY_ID, "Authority-ID" },
74 { TEAP_IDENTITY, "Identity-Type" },
75 { TEAP_RESULT, "Result" },
76 { TEAP_NAK, "NAK" },
77 { TEAP_ERROR, "Error" },
78 { TEAP_CHANNEL_BINDING, "Channel-Binding" },
79 { TEAP_VENDOR_SPECIFIC, "Vendor-Specific" },
80 { TEAP_REQUEST_ACTION, "Request-Action" },
81 { TEAP_EAP_PAYLOAD, "EAP-Payload" },
82 { TEAP_INTERMEDIATE_RESULT, "Intermediate-Result" },
83 { TEAP_PAC, "PAC" },
84 { TEAP_CRYPTO_BINDING, "Crypto-Binding" },
85 { TEAP_BASIC_PWD_AUTH_REQUEST, "Basic-Password-Auth-Req" },
86 { TEAP_BASIC_PWD_AUTH_RESPONSE, "Basic-Password-Auth-Resp" },
87 { TEAP_PKCS7, "PKCS#7" },
88 { TEAP_PKCS10, "PKCS#10" },
89 { TEAP_TRUSTED_SERVER_ROOT, "Trusted-Server-Root" },
90 { 0, NULL }
93 static const value_string teap_identity_vals[] = {
94 { 1, "User" },
95 { 2, "Machine" },
96 { 0, NULL }
99 static const value_string teap_status_vals[] = {
100 { 1, "Success" },
101 { 2, "Failure" },
102 { 0, NULL }
105 static const value_string teap_request_action_status_vals[] = {
106 { 1, "Success" },
107 { 2, "Failure" },
108 { 0, NULL }
111 static const value_string teap_request_action_action_vals[] = {
112 { 1, "Process-TLV" },
113 { 2, "Negotiate-EAP" },
114 { 0, NULL }
117 #define FLAG_EMSK_PRESENT 1
118 #define FLAG_MSK_PRESENT 2
119 #define FLAG_BOTH_PRESENT 3
121 static const value_string teap_crypto_flags_vals[] = {
122 { FLAG_EMSK_PRESENT, "EMSK Compound MAC is present" },
123 { FLAG_MSK_PRESENT, "MSK Compound MAC is present" },
124 { FLAG_BOTH_PRESENT, "Both EMSK and MSK Compound MAC are present" },
125 { 0, NULL }
128 static const value_string teap_crypto_subtype_vals[] = {
129 { 0, "Binding Request" },
130 { 1, "Binding Response" },
131 { 0, NULL }
134 static const value_string teap_error_code_vals[] = {
135 { 1, "User account expires soon" },
136 { 2, "User account credential expires soon" },
137 { 3, "User account authorizations change soon" },
138 { 4, "Clock skew detected" },
139 { 5, "Contact administrator" },
140 { 6, "User account credentials change required" },
141 { 1001, "Inner Method Error" },
142 { 1002, "Unspecified authentication infrastructure problem" },
143 { 1003, "Unspecified authentication failure" },
144 { 1004, "Unspecified authorization failure" },
145 { 1005, "User account credentials unavailable" },
146 { 1006, "User account expired" },
147 { 1007, "User account locked: try again later" },
148 { 1008, "User account locked: admin intervention required" },
149 { 1009, "Authentication infrastructure unavailable" },
150 { 1010, "Authentication infrastructure not trusted" },
151 { 1011, "Clock skew too great" },
152 { 1012, "Invalid inner realm" },
153 { 1013, "Token out of sync: administrator intervention required" },
154 { 1014, "Token out of sync: PIN change required" },
155 { 1015, "Token revoked" },
156 { 1016, "Tokens exhausted" },
157 { 1017, "Challenge expired" },
158 { 1018, "Challenge algorithm mismatch" },
159 { 1019, "Client certificate not supplied" },
160 { 1020, "Client certificate rejected" },
161 { 1021, "Realm mismatch between inner and outer identity" },
162 { 1022, "Unsupported Algorithm In Certificate Signing Request" },
163 { 1023, "Unsupported Extension In Certificate Signing Request" },
164 { 1024, "Bad Identity In Certificate Signing Request" },
165 { 1025, "Bad Certificate Signing Request" },
166 { 1026, "Internal CA Error" },
167 { 1027, "General PKI Error" },
168 { 1028, "Inner method's channel-binding data required but not supplied" },
169 { 1029, "Inner method's channel-binding data did not include required information" },
170 { 1030, "Inner method's channel binding failed" },
171 { 1031, "User account credentials incorrect [USAGE NOT RECOMMENDED]" },
172 { 2001, "Tunnel Compromise Error" },
173 { 2002, "Unexpected TLVs Exchanged" },
174 { 0, NULL }
177 #define PAC_KEY 1
178 #define PAC_OPAQUE 2
179 #define PAC_LIFETIME 3
180 #define PAC_A_ID 4
181 #define PAC_I_ID 5
182 #define PAC_RESERVED 6
183 #define PAC_A_ID_INFO 7
184 #define PAC_ACK 8
185 #define PAC_INFO 9
186 #define PAC_TYPE 10
188 static const value_string pac_attr_type_vals[] = {
189 { PAC_KEY, "PAC-Key" },
190 { PAC_OPAQUE, "PAC-Opaque" },
191 { PAC_LIFETIME, "PAC-Lifetime" },
192 { PAC_A_ID, "A-ID" },
193 { PAC_I_ID, "I-ID" },
194 { PAC_RESERVED, "Reserved" },
195 { PAC_A_ID_INFO, "A-ID-Info" },
196 { PAC_ACK, "PAC-Acknowledgement" },
197 { PAC_INFO, "PAC-Info" },
198 { PAC_TYPE, "PAC-Type" },
199 { 0, NULL }
202 static const value_string pac_result_vals[] = {
203 { 1, "Success" },
204 { 2, "Failure" },
205 { 0, NULL }
208 static const value_string pac_type_vals[] = {
209 { 1, "Tunnel PAC" },
210 { 0, NULL }
213 static int hf_teap_tlv_mandatory;
214 static int hf_teap_tlv_reserved;
215 static int hf_teap_tlv_type;
216 static int hf_teap_tlv_len;
217 static int hf_teap_tlv_val;
218 static int hf_teap_auth_id;
219 static int hf_teap_identity;
220 static int hf_teap_status;
221 static int hf_teap_vendor_id;
222 static int hf_teap_request_action_status;
223 static int hf_teap_request_action_action;
224 static int hf_teap_crypto_reserved;
225 static int hf_teap_crypto_version;
226 static int hf_teap_crypto_rcv_version;
227 static int hf_teap_crypto_flags;
228 static int hf_teap_crypto_subtype;
229 static int hf_teap_crypto_nonce;
230 static int hf_teap_crypto_emsk;
231 static int hf_teap_crypto_msk;
232 static int hf_teap_nak_type;
233 static int hf_teap_error_code;
234 static int hf_teap_prompt;
235 static int hf_teap_user_len;
236 static int hf_teap_username;
237 static int hf_teap_pass_len;
238 static int hf_teap_password;
240 static int hf_pac_attr_type;
241 static int hf_pac_attr_pac_key;
242 static int hf_pac_attr_pac_opaque;
243 static int hf_pac_attr_pac_lifetime;
244 static int hf_pac_attr_pac_a_id;
245 static int hf_pac_attr_pac_i_id;
246 static int hf_pac_attr_pac_reserved;
247 static int hf_pac_attr_pac_a_id_info;
248 static int hf_pac_attr_pac_result;
249 static int hf_pac_attr_pac_type;
250 static int hf_pac_attr_val;
252 static int
253 dissect_teap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_);
255 static int
256 dissect_teap_tlv_pac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, uint16_t len);
258 static int
259 // NOLINTNEXTLINE(misc-no-recursion)
260 dissect_pac_attr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
262 uint16_t type;
263 uint16_t len;
264 int start_offset = offset;
266 type = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
267 len = tvb_get_uint16(tvb, offset + 2, ENC_BIG_ENDIAN);
269 proto_tree_add_item(tree, hf_pac_attr_type, tvb, offset, 2, ENC_BIG_ENDIAN);
270 offset += 2;
272 proto_tree_add_item(tree, hf_teap_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
273 offset += 2;
275 switch (type) {
276 case PAC_KEY:
277 proto_tree_add_item(tree, hf_pac_attr_pac_key, tvb, offset, len, ENC_NA);
278 offset += len;
279 break;
281 case PAC_OPAQUE:
282 proto_tree_add_item(tree, hf_pac_attr_pac_opaque, tvb, offset, len, ENC_NA);
283 offset += len;
284 break;
286 case PAC_LIFETIME:
287 proto_tree_add_item(tree, hf_pac_attr_pac_lifetime, tvb, offset, 4, ENC_NA);
288 offset += 4;
289 break;
291 case PAC_A_ID:
292 proto_tree_add_item(tree, hf_pac_attr_pac_a_id, tvb, offset, len, ENC_ASCII | ENC_NA);
293 offset += len;
294 break;
296 case PAC_I_ID:
297 proto_tree_add_item(tree, hf_pac_attr_pac_i_id, tvb, offset, len, ENC_ASCII | ENC_NA);
298 offset += len;
299 break;
301 case PAC_RESERVED:
302 proto_tree_add_item(tree, hf_pac_attr_pac_reserved, tvb, offset, len, ENC_NA);
303 offset += len;
304 break;
306 case PAC_A_ID_INFO:
307 proto_tree_add_item(tree, hf_pac_attr_pac_a_id_info, tvb, offset, len, ENC_ASCII | ENC_NA);
308 offset += len;
309 break;
311 case PAC_ACK:
312 proto_tree_add_item(tree, hf_pac_attr_pac_result, tvb, offset, len, ENC_NA);
313 offset += len;
314 break;
316 case PAC_INFO:
317 offset += dissect_teap_tlv_pac(tvb, pinfo, tree, offset, len);
318 break;
320 case PAC_TYPE:
321 proto_tree_add_item(tree, hf_pac_attr_pac_type, tvb, offset, len, ENC_NA);
322 offset += len;
323 break;
325 default:
326 proto_tree_add_item(tree, hf_pac_attr_val, tvb, offset, len, ENC_NA);
327 offset += len;
328 break;
330 return offset - start_offset;
333 static int
334 // NOLINTNEXTLINE(misc-no-recursion)
335 dissect_teap_tlv_pac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, uint16_t len)
337 int start_offset = offset;
339 increment_dissection_depth(pinfo);
340 while (offset - start_offset < len) {
341 offset += dissect_pac_attr(tvb, pinfo, tree, offset);
343 decrement_dissection_depth(pinfo);
344 return offset - start_offset;
347 static int
348 // NOLINTNEXTLINE(misc-no-recursion)
349 dissect_teap_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, bool top)
351 int start_offset = offset;
352 uint16_t type;
353 uint16_t len;
354 proto_tree *tlv_tree;
355 proto_tree *ti_len;
356 tvbuff_t *next_tvb;
358 type = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN) & TEAP_TLV_TYPE;
359 len = tvb_get_uint16(tvb, offset + 2, ENC_BIG_ENDIAN);
361 tlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4 + len,
362 ett_teap_tlv, NULL, "TLV %s (%u): ",
363 val_to_str_const(type, teap_tlv_type_vals, "Unknown"), type);
365 proto_tree_add_item(tlv_tree, hf_teap_tlv_mandatory, tvb, offset, 2, ENC_BIG_ENDIAN);
366 proto_tree_add_item(tlv_tree, hf_teap_tlv_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
367 proto_tree_add_item(tlv_tree, hf_teap_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN);
368 offset += 2;
370 proto_tree_add_item(tlv_tree, hf_teap_tlv_len, tvb, offset, 2, ENC_BIG_ENDIAN);
371 offset += 2;
373 if (top) {
374 col_add_str(pinfo->cinfo, COL_INFO,
375 val_to_str(type, teap_tlv_type_vals, "Unknown TLV (0x%02X)"));
377 switch (type) {
378 case TEAP_AUTHORITY_ID:
379 proto_tree_add_item(tlv_tree, hf_teap_auth_id, tvb, offset, len, ENC_NA);
380 offset += len;
381 break;
383 case TEAP_IDENTITY:
384 proto_tree_add_item(tlv_tree, hf_teap_identity, tvb, offset, 2, ENC_BIG_ENDIAN);
385 offset += len;
386 break;
388 case TEAP_RESULT:
389 proto_tree_add_item(tlv_tree, hf_teap_status, tvb, offset, 2, ENC_BIG_ENDIAN);
390 offset += len;
391 break;
393 case TEAP_NAK:
394 proto_tree_add_item(tlv_tree, hf_teap_vendor_id, tvb, offset, 4, ENC_BIG_ENDIAN);
395 offset += 4;
396 proto_tree_add_item(tlv_tree, hf_teap_nak_type, tvb, offset, 2, ENC_BIG_ENDIAN);
397 offset += 2;
399 if (len > 6) {
400 next_tvb = tvb_new_subset_length(tvb, offset, len - 6);
401 increment_dissection_depth(pinfo);
402 offset += dissect_teap(next_tvb, pinfo, tlv_tree, NULL);
403 decrement_dissection_depth(pinfo);
406 break;
408 case TEAP_ERROR:
409 proto_tree_add_item(tlv_tree, hf_teap_error_code, tvb, offset, 4, ENC_BIG_ENDIAN);
410 offset += len;
411 break;
413 case TEAP_VENDOR_SPECIFIC:
414 proto_tree_add_item(tlv_tree, hf_teap_vendor_id, tvb, offset, 4, ENC_BIG_ENDIAN);
415 offset += len;
416 break;
418 case TEAP_REQUEST_ACTION:
419 proto_tree_add_item(tlv_tree, hf_teap_request_action_status, tvb, offset, 1, ENC_BIG_ENDIAN);
420 offset += 1;
421 proto_tree_add_item(tlv_tree, hf_teap_request_action_action, tvb, offset, 1, ENC_BIG_ENDIAN);
422 offset += 1;
424 if (len > 2) {
425 next_tvb = tvb_new_subset_length(tvb, offset, len - 2);
426 offset += dissect_teap(next_tvb, pinfo, tlv_tree, NULL);
429 break;
431 case TEAP_EAP_PAYLOAD:
433 uint16_t eaplen = tvb_get_uint16(tvb, offset + 2, ENC_BIG_ENDIAN);
435 next_tvb = tvb_new_subset_length(tvb, offset, eaplen);
436 call_dissector(eap_handle, next_tvb, pinfo, tlv_tree);
437 offset += eaplen;
439 if (len > eaplen) {
440 next_tvb = tvb_new_subset_length(tvb, offset, len - eaplen);
441 offset += dissect_teap(next_tvb, pinfo, tlv_tree, NULL);
444 break;
446 case TEAP_INTERMEDIATE_RESULT:
447 proto_tree_add_item(tlv_tree, hf_teap_status, tvb, offset, 2, ENC_BIG_ENDIAN);
448 offset += 2;
450 if (len > 2) {
451 next_tvb = tvb_new_subset_length(tvb, offset, len - 2);
452 offset += dissect_teap(next_tvb, pinfo, tlv_tree, NULL);
455 break;
457 case TEAP_PAC:
458 offset += dissect_teap_tlv_pac(tvb, pinfo, tlv_tree, offset, len);
459 break;
461 case TEAP_CRYPTO_BINDING:
463 uint8_t flags;
464 proto_tree_add_item(tlv_tree, hf_teap_crypto_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
465 offset += 1;
466 proto_tree_add_item(tlv_tree, hf_teap_crypto_version, tvb, offset, 1, ENC_BIG_ENDIAN);
467 offset += 1;
468 proto_tree_add_item(tlv_tree, hf_teap_crypto_rcv_version, tvb, offset, 1, ENC_BIG_ENDIAN);
469 offset += 1;
470 flags = (tvb_get_uint8(tvb, offset) & TEAP_CRYPTO_FLAGS) >> 4;
471 proto_tree_add_item(tlv_tree, hf_teap_crypto_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
472 proto_tree_add_item(tlv_tree, hf_teap_crypto_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
473 offset += 1;
474 proto_tree_add_item(tlv_tree, hf_teap_crypto_nonce, tvb, offset, 32, ENC_NA);
475 offset += 32;
476 if (flags == FLAG_EMSK_PRESENT || flags == FLAG_BOTH_PRESENT) {
477 proto_tree_add_item(tlv_tree, hf_teap_crypto_emsk, tvb, offset, 20, ENC_NA);
479 offset += 20;
480 if (flags == FLAG_MSK_PRESENT || flags == FLAG_BOTH_PRESENT) {
481 proto_tree_add_item(tlv_tree, hf_teap_crypto_msk, tvb, offset, 20, ENC_NA);
483 offset += 20;
485 break;
487 case TEAP_BASIC_PWD_AUTH_REQUEST:
488 if (len > 0) {
489 proto_tree_add_item(tlv_tree, hf_teap_prompt, tvb, offset, len, ENC_ASCII | ENC_NA);
490 offset += len;
492 break;
494 case TEAP_BASIC_PWD_AUTH_RESPONSE:
496 uint8_t auth_len;
497 auth_len = tvb_get_uint8(tvb, offset);
498 proto_tree_add_item(tlv_tree, hf_teap_user_len, tvb, offset, 1, ENC_BIG_ENDIAN);
499 offset += 1;
500 proto_tree_add_item(tlv_tree, hf_teap_username, tvb, offset, auth_len, ENC_ASCII | ENC_NA);
501 offset += auth_len;
503 auth_len = tvb_get_uint8(tvb, offset);
504 proto_tree_add_item(tlv_tree, hf_teap_pass_len, tvb, offset, 1, ENC_BIG_ENDIAN);
505 offset += 1;
506 proto_tree_add_item(tlv_tree, hf_teap_password, tvb, offset, auth_len, ENC_ASCII | ENC_NA);
507 offset += auth_len;
509 break;
511 case TEAP_CHANNEL_BINDING:
512 case TEAP_TRUSTED_SERVER_ROOT:
513 case TEAP_PKCS7:
514 case TEAP_PKCS10:
515 default:
516 ti_len = proto_tree_add_item(tlv_tree, hf_teap_tlv_val, tvb, offset, len, ENC_NA);
517 if ((unsigned)len + 4 > tvb_reported_length(tvb)) {
518 expert_add_info(pinfo, ti_len, &ei_teap_bad_length);
520 offset += len;
521 break;
524 return offset - start_offset;
527 static int
528 // NOLINTNEXTLINE(misc-no-recursion)
529 dissect_teap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
531 proto_tree *ti;
532 proto_tree *teap_tree;
533 int offset = 0;
535 col_set_str(pinfo->cinfo, COL_PROTOCOL, "TEAP");
536 col_clear(pinfo->cinfo, COL_INFO);
538 ti = proto_tree_add_item(tree, proto_teap, tvb, 0, tvb_captured_length(tvb), ENC_NA);
539 teap_tree = proto_item_add_subtree(ti, ett_teap);
541 while (offset < (int)tvb_captured_length(tvb)) {
542 offset += dissect_teap_tlv(tvb, pinfo, teap_tree, offset, offset == 0);
545 return tvb_captured_length(tvb);
548 void
549 proto_register_teap(void)
551 static hf_register_info hf[] = {
552 { &hf_teap_tlv_mandatory, {
553 "Mandatory", "teap.tlv.mandatory",
554 FT_BOOLEAN, 16, NULL, TEAP_TLV_MANDATORY,
555 NULL, HFILL }},
557 { &hf_teap_tlv_reserved, {
558 "Reserved", "teap.tlv.reserved",
559 FT_UINT16, BASE_DEC, NULL, TEAP_TLV_RESERVED,
560 NULL, HFILL }},
562 { &hf_teap_tlv_type, {
563 "Type", "teap.tlv.type",
564 FT_UINT16, BASE_DEC, VALS(teap_tlv_type_vals), TEAP_TLV_TYPE,
565 NULL, HFILL }},
567 { &hf_teap_tlv_len, {
568 "Length", "teap.tlv.len",
569 FT_UINT16, BASE_DEC, NULL, 0x00,
570 NULL, HFILL }},
572 { &hf_teap_auth_id, {
573 "ID", "teap.authority-id",
574 FT_BYTES, BASE_NONE, NULL, 0x0,
575 NULL, HFILL }},
577 { &hf_teap_identity, {
578 "Identity", "teap.identity",
579 FT_UINT16, BASE_DEC, VALS(teap_identity_vals), 0x0,
580 NULL, HFILL }},
582 { &hf_teap_status, {
583 "Status", "teap.status",
584 FT_UINT16, BASE_DEC, VALS(teap_status_vals), 0x0,
585 NULL, HFILL }},
587 { &hf_teap_vendor_id, {
588 "Vendor-Id", "teap.vendor-id",
589 FT_UINT32, BASE_HEX, NULL, 0x0,
590 NULL, HFILL }},
592 { &hf_teap_crypto_reserved, {
593 "Reserved", "teap.crypto.reserved",
594 FT_UINT8, BASE_DEC, NULL, 0x0,
595 NULL, HFILL }},
597 { &hf_teap_crypto_version, {
598 "Version", "teap.crypto.version",
599 FT_UINT8, BASE_DEC, NULL, 0x0,
600 NULL, HFILL }},
602 { &hf_teap_crypto_rcv_version, {
603 "Received Version", "teap.crypto.received-version",
604 FT_UINT8, BASE_DEC, NULL, 0x0,
605 NULL, HFILL }},
607 { &hf_teap_crypto_flags, {
608 "Flags", "teap.crypto.flags",
609 FT_UINT8, BASE_DEC, VALS(teap_crypto_flags_vals), TEAP_CRYPTO_FLAGS,
610 NULL, HFILL }},
612 { &hf_teap_crypto_subtype, {
613 "Subtype", "teap.crypto.subtype",
614 FT_UINT8, BASE_DEC, VALS(teap_crypto_subtype_vals), TEAP_CRYPTO_SUBTYPE,
615 NULL, HFILL }},
617 { &hf_teap_crypto_nonce, {
618 "Nonce", "teap.crypto.nonce",
619 FT_BYTES, BASE_NONE, NULL, 0x0,
620 NULL, HFILL }},
622 { &hf_teap_crypto_emsk, {
623 "EMSK Compound MAC", "teap.crypto.emsk",
624 FT_BYTES, BASE_NONE, NULL, 0x0,
625 NULL, HFILL }},
627 { &hf_teap_crypto_msk, {
628 "MSK Compound MAC", "teap.crypto.msk",
629 FT_BYTES, BASE_NONE, NULL, 0x0,
630 NULL, HFILL }},
632 { &hf_teap_nak_type, {
633 "NAK-Type", "teap.nak-type",
634 FT_UINT16, BASE_HEX, NULL, 0x0,
635 NULL, HFILL }},
637 { &hf_teap_error_code, {
638 "Error-Code", "teap.error-code",
639 FT_UINT32, BASE_DEC, VALS(teap_error_code_vals), 0x0,
640 NULL, HFILL }},
642 { &hf_teap_request_action_action, {
643 "Action", "teap.request-action.action",
644 FT_UINT8, BASE_DEC, VALS(teap_request_action_action_vals), 0x0,
645 NULL, HFILL }},
647 { &hf_teap_request_action_status, {
648 "Status", "teap.request-action.status",
649 FT_UINT8, BASE_DEC, VALS(teap_request_action_status_vals), 0x0,
650 NULL, HFILL }},
652 { &hf_teap_prompt, {
653 "Prompt", "teap.prompt",
654 FT_STRING, BASE_NONE, NULL, 0x0,
655 NULL, HFILL }},
657 { &hf_teap_user_len, {
658 "Userlen", "teap.user_len",
659 FT_UINT8, BASE_DEC, NULL, 0x0,
660 NULL, HFILL }},
662 { &hf_teap_username, {
663 "Username", "teap.username",
664 FT_STRING, BASE_NONE, NULL, 0x0,
665 NULL, HFILL }},
667 { &hf_teap_pass_len, {
668 "Passlen", "teap.pass_len",
669 FT_UINT8, BASE_DEC, NULL, 0x0,
670 NULL, HFILL }},
672 { &hf_teap_password, {
673 "Password", "teap.password",
674 FT_STRING, BASE_NONE, NULL, 0x0,
675 NULL, HFILL }},
677 { &hf_teap_tlv_val, {
678 "Value", "teap.tlv.val",
679 FT_BYTES, BASE_NONE, NULL, 0x0,
680 NULL, HFILL }},
682 { &hf_pac_attr_type, {
683 "Type", "teap.pac.type",
684 FT_UINT16, BASE_DEC, VALS(pac_attr_type_vals), 0x0,
685 NULL, HFILL }},
687 { &hf_pac_attr_pac_key, {
688 "Key", "teap.pac.key",
689 FT_BYTES, BASE_NONE, NULL, 0x0,
690 NULL, HFILL }},
692 { &hf_pac_attr_pac_opaque, {
693 "Opaque", "teap.pac.opaque",
694 FT_BYTES, BASE_NONE, NULL, 0x0,
695 NULL, HFILL }},
697 { &hf_pac_attr_pac_lifetime, {
698 "Lifetime", "teap.pac.lifetime",
699 FT_UINT32, BASE_DEC, NULL, 0x0,
700 NULL, HFILL }},
702 { &hf_pac_attr_pac_a_id, {
703 "A-ID", "teap.pac.a-id",
704 FT_STRING, BASE_NONE, NULL, 0x0,
705 NULL, HFILL }},
707 { &hf_pac_attr_pac_i_id, {
708 "I-ID", "teap.pac.i-id",
709 FT_STRING, BASE_NONE, NULL, 0x0,
710 NULL, HFILL }},
712 { &hf_pac_attr_pac_reserved, {
713 "Reserved", "teap.pac.reserved",
714 FT_BYTES, BASE_NONE, NULL, 0x0,
715 NULL, HFILL }},
717 { &hf_pac_attr_pac_a_id_info, {
718 "A-ID-Info", "teap.pac.a-id-info",
719 FT_STRING, BASE_NONE, NULL, 0x0,
720 NULL, HFILL }},
722 { &hf_pac_attr_pac_result, {
723 "Type", "teap.pac.result",
724 FT_UINT16, BASE_DEC, VALS(pac_result_vals), 0x0,
725 NULL, HFILL }},
727 { &hf_pac_attr_pac_type, {
728 "Type", "teap.pac.pac-type",
729 FT_UINT16, BASE_DEC, VALS(pac_type_vals), 0x0,
730 NULL, HFILL }},
732 { &hf_pac_attr_val, {
733 "Value", "teap.pac.val",
734 FT_BYTES, BASE_NONE, NULL, 0x0,
735 NULL, HFILL }},
738 static int *ett[] = {
739 &ett_teap,
740 &ett_teap_tlv,
741 &ett_pac_attr_tlv,
743 static ei_register_info ei[] = {
744 { &ei_teap_bad_length, { "teap.bad_length", PI_PROTOCOL, PI_WARN, "Bad length (too large)", EXPFILL }},
747 expert_module_t* expert_teap;
749 proto_teap = proto_register_protocol("Tunnel Extensible Authentication Protocol",
750 "TEAP", "teap");
751 proto_register_field_array(proto_teap, hf, array_length(hf));
752 proto_register_subtree_array(ett, array_length(ett));
753 expert_teap = expert_register_protocol(proto_teap);
754 expert_register_field_array(expert_teap, ei, array_length(ei));
756 teap_handle = register_dissector("teap", dissect_teap, proto_teap);
759 void
760 proto_reg_handoff_teap(void)
762 eap_handle = find_dissector_add_dependency("eap", proto_teap);
765 * Editor modelines
767 * Local Variables:
768 * c-basic-offset: 2
769 * tab-width: 8
770 * indent-tabs-mode: nil
771 * End:
773 * ex: set shiftwidth=2 tabstop=8 expandtab:
774 * :indentSize=2:tabSize=8:noTabs=true: