aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Sharpe <realrichardsharpe@gmail.com>2018-01-15 19:37:56 -0800
committerAnders Broman <a.broman58@gmail.com>2018-01-16 06:08:48 +0000
commita069a4f856c29b25bae05f2a91d7b2b71e1905f3 (patch)
tree6c7145aa681dcd4df641ea6ffdb92cfd879e8768
parenta165a80452a49ef383a313b21ebc02925104abaf (diff)
ieee80211: Add support for EAPOL Key MIC lengths other than 16.
This allows the user to override the EAPOL Key MIC length for those crypto suites where the Key MIC length is greater than 16 bytes. This works in the DPP case where the Key MIC length is supposed to be the same as the Nonce length. Change-Id: I8ef6bc978e0a44ece0e95d76b231a02c7f15c89b Reviewed-on: https://code.wireshark.org/review/25332 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-ieee80211.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index d74f760705..11c90184a3 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -126,6 +126,9 @@ static gboolean wlan_ignore_draft_ht = FALSE;
#define WLAN_IGNORE_PROT_W_IV 2
static gint wlan_ignore_prot = WLAN_IGNORE_PROT_NO;
+/* The Key MIC len has been set by the user */
+static guint wlan_key_mic_len = 0;
+
/* Table for reassembly of fragments. */
static reassembly_table wlan_reassembly_table;
@@ -19852,11 +19855,21 @@ dissect_wlan_rsna_eapol_wpa_or_rsn_key(tvbuff_t *tvb, packet_info *pinfo, proto_
&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message,
NULL
};
+ guint16 eapol_data_offset = 76; /* 92 - 16 */
+ guint16 eapol_key_mic_len = 0;
+
+ if (wlan_key_mic_len) {
+ eapol_data_offset += wlan_key_mic_len;
+ eapol_key_mic_len = wlan_key_mic_len;
+ } else {
+ eapol_data_offset = 92;
+ eapol_key_mic_len = 16;
+ }
/*
* RSNA key descriptors.
*/
- eapol_data_len = tvb_get_ntohs(tvb, offset+92);
+ eapol_data_len = tvb_get_ntohs(tvb, offset+eapol_data_offset);
keyinfo = tvb_get_ntohs(tvb, offset);
if (keyinfo & KEY_INFO_REQUEST_MASK) {
col_set_str(pinfo->cinfo, COL_INFO, "Key (Request)");
@@ -19940,8 +19953,8 @@ dissect_wlan_rsna_eapol_wpa_or_rsn_key(tvbuff_t *tvb, packet_info *pinfo, proto_
ENC_NA);
offset += 8;
proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_mic, tvb, offset,
- 16, ENC_NA);
- offset += 16;
+ eapol_key_mic_len, ENC_NA);
+ offset += eapol_key_mic_len;
proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data_len, tvb,
offset, 2, ENC_BIG_ENDIAN);
offset += 2;
@@ -28996,6 +29009,11 @@ proto_register_ieee80211(void)
"and some also leave the IV (initialization vector).",
&wlan_ignore_prot, wlan_ignore_prot_options, TRUE);
+ prefs_register_uint_preference(wlan_module, "wpa_key_mic_len",
+ "WPA Key MIC Length override",
+ "Some Key MIC lengths are greater than 16 bytes, so set the length you require",
+ 10, &wlan_key_mic_len);
+
prefs_register_obsolete_preference(wlan_module, "wep_keys");
prefs_register_bool_preference(wlan_module, "enable_decryption",