2001-11-06 20:30:40 +00:00
|
|
|
/* packet-eapol.c
|
|
|
|
* Routines for EAPOL 802.1X authentication header disassembly
|
2002-02-22 23:05:16 +00:00
|
|
|
* (From IEEE Draft P802.1X/D11; is there a later draft, or a
|
|
|
|
* final standard? If so, check it.)
|
2001-11-06 20:30:40 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2001-11-06 20:30:40 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-11-06 20:30:40 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-11-06 20:30:40 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-11-06 20:30:40 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-11-06 20:30:40 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2007-01-26 21:54:59 +00:00
|
|
|
#include <epan/crypt/wep-wpadefs.h>
|
2003-09-23 02:35:59 +00:00
|
|
|
#include "packet-ieee80211.h"
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/etypes.h>
|
2001-11-06 20:30:40 +00:00
|
|
|
|
|
|
|
static int proto_eapol = -1;
|
|
|
|
static int hf_eapol_version = -1;
|
|
|
|
static int hf_eapol_type = -1;
|
|
|
|
static int hf_eapol_len = -1;
|
2002-02-22 23:05:16 +00:00
|
|
|
static int hf_eapol_keydes_type = -1;
|
|
|
|
static int hf_eapol_keydes_keylen = -1;
|
|
|
|
static int hf_eapol_keydes_replay_counter = -1;
|
|
|
|
static int hf_eapol_keydes_key_iv = -1;
|
|
|
|
static int hf_eapol_keydes_key_index_keytype = -1;
|
|
|
|
static int hf_eapol_keydes_key_index_indexnum = -1;
|
|
|
|
static int hf_eapol_keydes_key_signature = -1;
|
|
|
|
static int hf_eapol_keydes_key = -1;
|
2001-11-06 20:30:40 +00:00
|
|
|
|
2003-06-03 01:20:14 +00:00
|
|
|
static int hf_eapol_wpa_keydes_keyinfo = -1;
|
2003-10-14 09:11:53 +00:00
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_keydes_ver = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_key_type = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_key_index = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_install = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_key_ack = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_key_mic = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_secure = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_error = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_request = -1;
|
2004-03-28 00:26:13 +00:00
|
|
|
static int hf_eapol_wpa_keydes_keyinfo_encr_key_data = -1;
|
2003-06-03 01:20:14 +00:00
|
|
|
static int hf_eapol_wpa_keydes_nonce = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_rsc = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_id = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_mic = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_datalen = -1;
|
|
|
|
static int hf_eapol_wpa_keydes_data = -1;
|
|
|
|
|
2001-11-06 20:30:40 +00:00
|
|
|
static gint ett_eapol = -1;
|
2003-09-23 02:35:59 +00:00
|
|
|
static gint ett_eapol_keydes_data = -1;
|
2002-02-22 23:05:16 +00:00
|
|
|
static gint ett_eapol_key_index = -1;
|
2003-10-14 09:11:53 +00:00
|
|
|
static gint ett_keyinfo = -1;
|
2001-11-06 20:30:40 +00:00
|
|
|
|
2002-02-22 21:51:18 +00:00
|
|
|
static dissector_handle_t eap_handle;
|
2001-11-26 04:52:51 +00:00
|
|
|
static dissector_handle_t data_handle;
|
|
|
|
|
2002-02-22 23:05:16 +00:00
|
|
|
#define EAPOL_HDR_LEN 4
|
|
|
|
|
|
|
|
#define EAP_PACKET 0
|
|
|
|
#define EAPOL_START 1
|
|
|
|
#define EAPOL_LOGOFF 2
|
|
|
|
#define EAPOL_KEY 3
|
|
|
|
#define EAPOL_ENCAP_ASF_ALERT 4
|
2001-11-06 20:30:40 +00:00
|
|
|
|
2004-03-30 19:15:24 +00:00
|
|
|
#define EAPOL_RSN_KEY 2 /* TBD, may change in final IEEE 802.1X-REV
|
|
|
|
*/
|
2003-06-03 01:20:14 +00:00
|
|
|
#define EAPOL_WPA_KEY 254
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static const value_string eapol_type_vals[] = {
|
2002-02-22 23:05:16 +00:00
|
|
|
{ EAP_PACKET, "EAP Packet" },
|
|
|
|
{ EAPOL_START, "Start" },
|
|
|
|
{ EAPOL_LOGOFF, "Logoff" },
|
|
|
|
{ EAPOL_KEY, "Key" },
|
|
|
|
{ EAPOL_ENCAP_ASF_ALERT, "Encapsulated ASF Alert" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string eapol_keydes_type_vals[] = {
|
|
|
|
{ 1, "RC4 Descriptor" },
|
2004-03-30 19:15:24 +00:00
|
|
|
{ EAPOL_RSN_KEY, "EAPOL RSN key" },
|
2003-06-03 01:20:14 +00:00
|
|
|
{ EAPOL_WPA_KEY, "EAPOL WPA key" },
|
2002-02-22 23:05:16 +00:00
|
|
|
{ 0, NULL }
|
2001-11-06 20:30:40 +00:00
|
|
|
};
|
|
|
|
|
2003-10-14 09:11:53 +00:00
|
|
|
#define KEY_INFO_KEYDES_VER_MASK 0x0007
|
|
|
|
#define KEY_INFO_KEY_TYPE_MASK 0x0008
|
2007-06-25 18:22:36 +00:00
|
|
|
#define KEY_INFO_KEY_INDEX_MASK 0x0030
|
2003-10-14 09:11:53 +00:00
|
|
|
#define KEY_INFO_INSTALL_MASK 0x0040
|
|
|
|
#define KEY_INFO_KEY_ACK_MASK 0x0080
|
|
|
|
#define KEY_INFO_KEY_MIC_MASK 0x0100
|
|
|
|
#define KEY_INFO_SECURE_MASK 0x0200
|
|
|
|
#define KEY_INFO_ERROR_MASK 0x0400
|
|
|
|
#define KEY_INFO_REQUEST_MASK 0x0800
|
2004-03-28 00:26:13 +00:00
|
|
|
#define KEY_INFO_ENCR_KEY_DATA_MASK 0x1000
|
2003-10-14 09:11:53 +00:00
|
|
|
|
2002-02-22 23:05:16 +00:00
|
|
|
static const true_false_string keytype_tfs =
|
|
|
|
{ "Unicast", "Broadcast" };
|
2003-10-14 09:11:53 +00:00
|
|
|
static const true_false_string tfs_keyinfo_key_type =
|
|
|
|
{ "Pairwise key", "Group key" };
|
|
|
|
#define KEYDES_VER_TYPE1 0x01
|
|
|
|
#define KEYDES_VER_TYPE2 0x02
|
|
|
|
static const value_string keydes_ver[] = {
|
|
|
|
{ KEYDES_VER_TYPE1, "HMAC-MD5 for MIC and RC4 for encryption" },
|
2006-06-29 09:53:12 +00:00
|
|
|
{ KEYDES_VER_TYPE2, "HMAC-SHA1 for MIC and AES-CCMP for encryption" },
|
2003-10-14 09:11:53 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
2002-02-22 23:05:16 +00:00
|
|
|
|
2001-11-06 20:30:40 +00:00
|
|
|
static void
|
|
|
|
dissect_eapol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2002-02-22 23:05:16 +00:00
|
|
|
int offset = 0;
|
|
|
|
guint8 eapol_type;
|
2003-06-03 01:20:14 +00:00
|
|
|
guint8 keydesc_type;
|
2002-02-22 23:05:16 +00:00
|
|
|
guint16 eapol_len;
|
2001-11-06 20:30:40 +00:00
|
|
|
guint len;
|
2003-06-03 01:20:14 +00:00
|
|
|
guint16 eapol_key_len, eapol_data_len;
|
2002-02-22 23:05:16 +00:00
|
|
|
guint8 key_index;
|
2003-10-14 09:11:53 +00:00
|
|
|
guint16 keyinfo;
|
2002-02-22 23:05:16 +00:00
|
|
|
proto_tree *ti = NULL;
|
|
|
|
proto_tree *eapol_tree = NULL;
|
2003-10-14 09:11:53 +00:00
|
|
|
proto_tree *keyinfo_item = NULL;
|
|
|
|
proto_tree *keyinfo_tree = NULL;
|
2003-09-23 02:35:59 +00:00
|
|
|
proto_tree *key_index_tree, *keydes_tree;
|
2001-11-06 20:30:40 +00:00
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "EAPOL");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2001-11-06 20:30:40 +00:00
|
|
|
|
|
|
|
if (tree) {
|
2002-02-22 23:05:16 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_eapol, tvb, 0, -1, FALSE);
|
2001-11-06 20:30:40 +00:00
|
|
|
eapol_tree = proto_item_add_subtree(ti, ett_eapol);
|
|
|
|
|
2002-02-22 23:05:16 +00:00
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_version, tvb, offset, 1, FALSE);
|
2001-11-06 20:30:40 +00:00
|
|
|
}
|
2002-02-22 23:05:16 +00:00
|
|
|
offset++;
|
2001-11-06 20:30:40 +00:00
|
|
|
|
2002-02-22 23:05:16 +00:00
|
|
|
eapol_type = tvb_get_guint8(tvb, offset);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_uint(eapol_tree, hf_eapol_type, tvb, offset, 1, eapol_type);
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
|
|
|
val_to_str(eapol_type, eapol_type_vals, "Unknown type (0x%02X)"));
|
|
|
|
offset++;
|
2001-11-06 20:30:40 +00:00
|
|
|
|
2002-02-22 23:05:16 +00:00
|
|
|
eapol_len = tvb_get_ntohs(tvb, offset);
|
|
|
|
len = EAPOL_HDR_LEN + eapol_len;
|
|
|
|
set_actual_length(tvb, len);
|
|
|
|
if (tree) {
|
|
|
|
proto_item_set_len(ti, len);
|
|
|
|
proto_tree_add_uint(eapol_tree, hf_eapol_len, tvb, offset, 2, eapol_len);
|
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
switch (eapol_type) {
|
|
|
|
|
|
|
|
case EAP_PACKET:
|
|
|
|
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
|
|
|
|
call_dissector(eap_handle, next_tvb, pinfo, eapol_tree);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EAPOL_KEY:
|
|
|
|
if (tree) {
|
2003-06-03 01:20:14 +00:00
|
|
|
keydesc_type = tvb_get_guint8(tvb, offset);
|
2002-02-22 23:05:16 +00:00
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_keydes_type, tvb, offset, 1, FALSE);
|
|
|
|
offset += 1;
|
2004-03-30 19:15:24 +00:00
|
|
|
if (keydesc_type == EAPOL_WPA_KEY || keydesc_type == EAPOL_RSN_KEY) {
|
2003-10-14 09:11:53 +00:00
|
|
|
keyinfo = tvb_get_ntohs(tvb, offset);
|
2007-01-26 21:54:59 +00:00
|
|
|
keyinfo_item =
|
2003-10-14 09:11:53 +00:00
|
|
|
proto_tree_add_uint(eapol_tree, hf_eapol_wpa_keydes_keyinfo, tvb,
|
|
|
|
offset, 2, keyinfo);
|
|
|
|
|
|
|
|
keyinfo_tree = proto_item_add_subtree(keyinfo_item, ett_keyinfo);
|
|
|
|
proto_tree_add_uint(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_keydes_ver, tvb, offset, 2, keyinfo);
|
|
|
|
proto_tree_add_boolean(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_key_type, tvb, offset, 2, keyinfo);
|
|
|
|
proto_tree_add_uint(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_key_index, tvb, offset, 2, keyinfo);
|
|
|
|
proto_tree_add_boolean(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_install, tvb, offset, 2, keyinfo);
|
|
|
|
proto_tree_add_boolean(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_key_ack, tvb, offset, 2, keyinfo);
|
|
|
|
proto_tree_add_boolean(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_key_mic, tvb, offset, 2, keyinfo);
|
|
|
|
proto_tree_add_boolean(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_secure, tvb, offset, 2, keyinfo);
|
|
|
|
proto_tree_add_boolean(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_error, tvb, offset, 2, keyinfo);
|
|
|
|
proto_tree_add_boolean(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_request, tvb, offset, 2, keyinfo);
|
2004-03-28 00:26:13 +00:00
|
|
|
proto_tree_add_boolean(keyinfo_tree, hf_eapol_wpa_keydes_keyinfo_encr_key_data, tvb, offset, 2, keyinfo);
|
2003-10-14 09:11:53 +00:00
|
|
|
|
2003-06-03 01:20:14 +00:00
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_uint(eapol_tree, hf_eapol_keydes_keylen, tvb, offset,
|
|
|
|
2, tvb_get_ntohs(tvb, offset));
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_keydes_replay_counter, tvb,
|
|
|
|
offset, 8, FALSE);
|
|
|
|
offset += 8;
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_wpa_keydes_nonce, tvb, offset,
|
|
|
|
32, FALSE);
|
|
|
|
offset += 32;
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_keydes_key_iv, tvb,
|
|
|
|
offset, 16, FALSE);
|
|
|
|
offset += 16;
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_wpa_keydes_rsc, tvb, offset,
|
|
|
|
8, FALSE);
|
|
|
|
offset += 8;
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_wpa_keydes_id, tvb, offset, 8,
|
|
|
|
FALSE);
|
|
|
|
offset += 8;
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_wpa_keydes_mic, tvb, offset,
|
|
|
|
16, FALSE);
|
|
|
|
offset += 16;
|
|
|
|
eapol_data_len = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_uint(eapol_tree, hf_eapol_wpa_keydes_datalen, tvb,
|
|
|
|
offset, 2, eapol_data_len);
|
|
|
|
offset += 2;
|
|
|
|
if (eapol_data_len != 0) {
|
2003-09-23 02:35:59 +00:00
|
|
|
ti = proto_tree_add_item(eapol_tree, hf_eapol_wpa_keydes_data,
|
2003-06-03 01:20:14 +00:00
|
|
|
tvb, offset, eapol_data_len, FALSE);
|
2007-06-25 18:22:36 +00:00
|
|
|
if ((keyinfo & KEY_INFO_ENCR_KEY_DATA_MASK) ||
|
2004-03-28 00:26:13 +00:00
|
|
|
!(keyinfo & KEY_INFO_KEY_TYPE_MASK)) {
|
|
|
|
/* RSN: EAPOL-Key Key Data is encrypted.
|
|
|
|
* WPA: Group Keys use encrypted Key Data.
|
2007-06-25 18:22:36 +00:00
|
|
|
* Cannot parse this without knowing the key.
|
|
|
|
* IEEE 802.11i-2004 8.5.2.
|
|
|
|
*/
|
2004-03-28 00:26:13 +00:00
|
|
|
} else {
|
|
|
|
keydes_tree = proto_item_add_subtree(ti, ett_eapol_keydes_data);
|
2004-12-20 00:00:06 +00:00
|
|
|
ieee_80211_add_tagged_parameters(tvb, offset, pinfo, keydes_tree,
|
2004-03-28 00:26:13 +00:00
|
|
|
eapol_data_len);
|
|
|
|
}
|
2003-06-03 01:20:14 +00:00
|
|
|
}
|
2006-07-11 16:18:36 +00:00
|
|
|
} else {
|
2003-06-03 01:20:14 +00:00
|
|
|
eapol_key_len = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_uint(eapol_tree, hf_eapol_keydes_keylen, tvb, offset, 2, eapol_key_len);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_keydes_replay_counter, tvb,
|
|
|
|
offset, 8, FALSE);
|
|
|
|
offset += 8;
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_keydes_key_iv, tvb,
|
|
|
|
offset, 16, FALSE);
|
|
|
|
offset += 16;
|
|
|
|
key_index = tvb_get_guint8(tvb, offset);
|
|
|
|
ti = proto_tree_add_text(eapol_tree, tvb, offset, 1,
|
|
|
|
"Key Index: %s, index %u",
|
|
|
|
(key_index & 0x80) ? "unicast" : "broadcast",
|
|
|
|
key_index & 0x7F);
|
|
|
|
key_index_tree = proto_item_add_subtree(ti, ett_eapol_key_index);
|
|
|
|
proto_tree_add_boolean(eapol_tree, hf_eapol_keydes_key_index_keytype,
|
|
|
|
tvb, offset, 1, key_index);
|
|
|
|
proto_tree_add_uint(eapol_tree, hf_eapol_keydes_key_index_indexnum,
|
|
|
|
tvb, offset, 1, key_index);
|
|
|
|
offset += 1;
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_keydes_key_signature, tvb,
|
|
|
|
offset, 16, FALSE);
|
|
|
|
offset += 16;
|
2006-07-11 16:18:36 +00:00
|
|
|
if (eapol_key_len != 0) {
|
|
|
|
if (eapol_len > 44) { /* Size of rc4 key with no key content */
|
|
|
|
proto_tree_add_item(eapol_tree, hf_eapol_keydes_key, tvb, offset,
|
2003-06-03 01:20:14 +00:00
|
|
|
eapol_key_len, FALSE);
|
2006-07-11 16:18:36 +00:00
|
|
|
} else {
|
|
|
|
/* IEEE 802.1X-2004 7.6.3.6: If no bytes remain, then */
|
|
|
|
proto_tree_add_text(eapol_tree, tvb, offset, 0, "Key: Use key locally generated by peer");
|
|
|
|
}
|
|
|
|
}
|
2003-06-03 01:20:14 +00:00
|
|
|
}
|
2002-02-22 23:05:16 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EAPOL_ENCAP_ASF_ALERT: /* XXX - is this an SNMP trap? */
|
|
|
|
default:
|
|
|
|
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo, eapol_tree);
|
|
|
|
break;
|
|
|
|
}
|
2001-11-06 20:30:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_eapol(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
2002-08-28 21:04:11 +00:00
|
|
|
{ &hf_eapol_version, {
|
|
|
|
"Version", "eapol.version", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2002-08-28 21:04:11 +00:00
|
|
|
{ &hf_eapol_type, {
|
|
|
|
"Type", "eapol.type", FT_UINT8, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
VALS(eapol_type_vals), 0x0, NULL, HFILL }},
|
2001-11-06 20:30:40 +00:00
|
|
|
{ &hf_eapol_len, {
|
|
|
|
"Length", "eapol.len", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2002-02-22 23:05:16 +00:00
|
|
|
{ &hf_eapol_keydes_type, {
|
|
|
|
"Descriptor Type", "eapol.keydes.type", FT_UINT8, BASE_DEC,
|
|
|
|
VALS(eapol_keydes_type_vals), 0x0, "Key Descriptor Type", HFILL }},
|
|
|
|
{ &hf_eapol_keydes_keylen, {
|
|
|
|
"Key Length", "eapol.keydes.keylen", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2002-02-22 23:05:16 +00:00
|
|
|
{ &hf_eapol_keydes_replay_counter, {
|
|
|
|
"Replay Counter", "eapol.keydes.replay_counter", FT_UINT64, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2002-02-22 23:05:16 +00:00
|
|
|
{ &hf_eapol_keydes_key_iv, {
|
|
|
|
"Key IV", "eapol.keydes.key_iv", FT_BYTES, BASE_NONE,
|
|
|
|
NULL, 0x0, "Key Initialization Vector", HFILL }},
|
|
|
|
{ &hf_eapol_keydes_key_index_keytype, {
|
|
|
|
"Key Type", "eapol.keydes.index.keytype", FT_BOOLEAN, 8,
|
|
|
|
TFS(&keytype_tfs), 0x80, "Key Type (unicast/broadcast)", HFILL }},
|
|
|
|
{ &hf_eapol_keydes_key_index_indexnum, {
|
|
|
|
"Index Number", "eapol.keydes.index.indexnum", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x7F, "Key Index number", HFILL }},
|
|
|
|
{ &hf_eapol_keydes_key_signature, {
|
|
|
|
"Key Signature", "eapol.keydes.key_signature", FT_BYTES, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2002-02-22 23:05:16 +00:00
|
|
|
{ &hf_eapol_keydes_key, {
|
|
|
|
"Key", "eapol.keydes.key", FT_BYTES, BASE_NONE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-06-03 01:20:14 +00:00
|
|
|
|
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo, {
|
|
|
|
"Key Information", "eapol.keydes.key_info", FT_UINT16,
|
|
|
|
BASE_HEX, NULL, 0x0, "WPA key info", HFILL }},
|
2003-10-14 09:11:53 +00:00
|
|
|
|
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_keydes_ver, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Key Descriptor Version",
|
|
|
|
"eapol.keydes.key_info.keydes_ver",
|
2003-10-14 09:11:53 +00:00
|
|
|
FT_UINT16, BASE_DEC, VALS(&keydes_ver),
|
2007-01-26 21:54:59 +00:00
|
|
|
KEY_INFO_KEYDES_VER_MASK,
|
2003-10-14 09:11:53 +00:00
|
|
|
"Key Descriptor Version Type", HFILL }},
|
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_key_type, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Key Type",
|
|
|
|
"eapol.keydes.key_info.key_type",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_keyinfo_key_type),
|
|
|
|
KEY_INFO_KEY_TYPE_MASK,
|
2003-10-14 09:11:53 +00:00
|
|
|
"Key Type (Pairwise or Group)", HFILL }},
|
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_key_index, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Key Index",
|
|
|
|
"eapol.keydes.key_info.key_index",
|
|
|
|
FT_UINT16, BASE_DEC, NULL,
|
|
|
|
KEY_INFO_KEY_INDEX_MASK,
|
2004-03-28 00:26:13 +00:00
|
|
|
"Key Index (0-3) (RSN: Reserved)", HFILL }},
|
2003-10-14 09:11:53 +00:00
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_install, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Install flag",
|
|
|
|
"eapol.keydes.key_info.install",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_set_notset),
|
2007-01-26 21:54:59 +00:00
|
|
|
KEY_INFO_INSTALL_MASK,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2003-10-14 09:11:53 +00:00
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_key_ack, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Key Ack flag",
|
|
|
|
"eapol.keydes.key_info.key_ack",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_set_notset),
|
2007-01-26 21:54:59 +00:00
|
|
|
KEY_INFO_KEY_ACK_MASK,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2003-10-14 09:11:53 +00:00
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_key_mic, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Key MIC flag",
|
|
|
|
"eapol.keydes.key_info.key_mic",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_set_notset),
|
2007-01-26 21:54:59 +00:00
|
|
|
KEY_INFO_KEY_MIC_MASK,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2003-10-14 09:11:53 +00:00
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_secure, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Secure flag",
|
|
|
|
"eapol.keydes.key_info.secure",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_set_notset),
|
2007-01-26 21:54:59 +00:00
|
|
|
KEY_INFO_SECURE_MASK,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2003-10-14 09:11:53 +00:00
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_error, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Error flag",
|
|
|
|
"eapol.keydes.key_info.error",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_set_notset),
|
2007-01-26 21:54:59 +00:00
|
|
|
KEY_INFO_ERROR_MASK,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2003-10-14 09:11:53 +00:00
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_request, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Request flag",
|
|
|
|
"eapol.keydes.key_info.request",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_set_notset),
|
2007-01-26 21:54:59 +00:00
|
|
|
KEY_INFO_REQUEST_MASK,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-03-28 00:26:13 +00:00
|
|
|
{ &hf_eapol_wpa_keydes_keyinfo_encr_key_data, {
|
2007-01-26 21:54:59 +00:00
|
|
|
"Encrypted Key Data flag",
|
|
|
|
"eapol.keydes.key_info.encr_key_data",
|
2009-07-07 14:54:15 +00:00
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_set_notset),
|
2007-01-26 21:54:59 +00:00
|
|
|
KEY_INFO_ENCR_KEY_DATA_MASK,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2003-06-03 01:20:14 +00:00
|
|
|
{ &hf_eapol_wpa_keydes_nonce, {
|
|
|
|
"Nonce", "eapol.keydes.nonce", FT_BYTES, BASE_NONE,
|
|
|
|
NULL, 0x0, "WPA Key Nonce", HFILL }},
|
|
|
|
{ &hf_eapol_wpa_keydes_rsc, {
|
|
|
|
"WPA Key RSC", "eapol.keydes.rsc", FT_BYTES, BASE_NONE, NULL,
|
|
|
|
0x0, "WPA Key Receive Sequence Counter", HFILL }},
|
|
|
|
{ &hf_eapol_wpa_keydes_id, {
|
2003-11-13 23:38:33 +00:00
|
|
|
"WPA Key ID", "eapol.keydes.id", FT_BYTES, BASE_NONE, NULL,
|
2004-03-28 00:26:13 +00:00
|
|
|
0x0, "WPA Key ID(RSN Reserved)", HFILL }},
|
2003-06-03 01:20:14 +00:00
|
|
|
{ &hf_eapol_wpa_keydes_mic, {
|
|
|
|
"WPA Key MIC", "eapol.keydes.mic", FT_BYTES, BASE_NONE, NULL,
|
|
|
|
0x0, "WPA Key Message Integrity Check", HFILL }},
|
|
|
|
{ &hf_eapol_wpa_keydes_datalen, {
|
|
|
|
"WPA Key Length", "eapol.keydes.datalen", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, "WPA Key Data Length", HFILL }},
|
|
|
|
{ &hf_eapol_wpa_keydes_data, {
|
|
|
|
"WPA Key", "eapol.keydes.data", FT_BYTES, BASE_NONE,
|
|
|
|
NULL, 0x0, "WPA Key Data", HFILL }},
|
2001-11-06 20:30:40 +00:00
|
|
|
};
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_eapol,
|
2003-09-23 02:35:59 +00:00
|
|
|
&ett_eapol_keydes_data,
|
2003-10-14 09:11:53 +00:00
|
|
|
&ett_keyinfo,
|
2002-02-22 23:05:16 +00:00
|
|
|
&ett_eapol_key_index
|
2001-11-06 20:30:40 +00:00
|
|
|
};
|
|
|
|
|
2005-05-05 17:07:58 +00:00
|
|
|
proto_eapol = proto_register_protocol("802.1X Authentication", "EAPOL", "eapol");
|
2001-11-06 20:30:40 +00:00
|
|
|
proto_register_field_array(proto_eapol, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_eapol(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t eapol_handle;
|
|
|
|
|
2002-02-22 21:51:18 +00:00
|
|
|
/*
|
|
|
|
* Get handles for the EAP and raw data dissectors.
|
|
|
|
*/
|
|
|
|
eap_handle = find_dissector("eap");
|
2001-11-26 04:52:51 +00:00
|
|
|
data_handle = find_dissector("data");
|
2002-02-22 21:51:18 +00:00
|
|
|
|
2001-12-03 04:00:26 +00:00
|
|
|
eapol_handle = create_dissector_handle(dissect_eapol, proto_eapol);
|
|
|
|
dissector_add("ethertype", ETHERTYPE_EAPOL, eapol_handle);
|
2004-04-07 06:04:22 +00:00
|
|
|
dissector_add("ethertype", ETHERTYPE_RSN_PREAUTH, eapol_handle);
|
2001-11-06 20:30:40 +00:00
|
|
|
}
|