diff options
author | Mikael Kanstrup <mikael.kanstrup@sony.com> | 2020-01-12 23:28:37 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-03-14 06:53:13 +0000 |
commit | eed31f13be8da5bb80d2fde68a67696e8b2da41e (patch) | |
tree | 05742d2e2be94d1103c6d96c2b781674cb63ceaa /epan/dissectors/packet-ieee80211.c | |
parent | 14bc684b18e775b9a18aef8c095bc2aaf1e8f877 (diff) |
ieee80211: Add CCMP-256 decryption support
Add support for decrypting CCMP-256 encrypted IEEE 802.11 traffic
Bug: 16197
Change-Id: I0c9ee09e5b71cb02e6d2381049fd5bbb02686f7f
Reviewed-on: https://code.wireshark.org/review/36344
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ieee80211.c')
-rw-r--r-- | epan/dissectors/packet-ieee80211.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 2f1b6119ae..91cdd77f23 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -24081,6 +24081,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo, #define PROTECTION_ALG_WEP DOT11DECRYPT_KEY_TYPE_WEP #define PROTECTION_ALG_TKIP DOT11DECRYPT_KEY_TYPE_TKIP #define PROTECTION_ALG_CCMP DOT11DECRYPT_KEY_TYPE_CCMP +#define PROTECTION_ALG_CCMP_256 DOT11DECRYPT_KEY_TYPE_CCMP_256 #define PROTECTION_ALG_RSNA PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP #define IS_TKIP(tvb, hdr_len) (tvb_get_guint8(tvb, hdr_len + 1) == \ ((tvb_get_guint8(tvb, hdr_len) | 0x20) & 0x7f)) @@ -25223,7 +25224,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo, if (algorithm==PROTECTION_ALG_TKIP) wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8, ett_wep_parameters, NULL, "TKIP parameters"); - else if (algorithm==PROTECTION_ALG_CCMP) + else if (algorithm == PROTECTION_ALG_CCMP || algorithm == PROTECTION_ALG_CCMP_256) wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8, ett_wep_parameters, NULL, "CCMP parameters"); else { @@ -25248,7 +25249,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo, tvb_get_guint8(tvb, hdr_len + 2)); proto_tree_add_string(wep_tree, hf_ieee80211_tkip_extiv, tvb, hdr_len, EXTIV_LEN, out_buff); - } else if (algorithm==PROTECTION_ALG_CCMP) { + } else if (algorithm == PROTECTION_ALG_CCMP || algorithm == PROTECTION_ALG_CCMP_256) { g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X", tvb_get_letohl(tvb, hdr_len + 4), tvb_get_guint8(tvb, hdr_len + 1), @@ -25392,7 +25393,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo, g_strlcpy(wlan_stats.protection, "WEP", MAX_PROTECT_LEN); } else if (algorithm == PROTECTION_ALG_TKIP) { g_strlcpy(wlan_stats.protection, "TKIP", MAX_PROTECT_LEN); - } else if (algorithm == PROTECTION_ALG_CCMP) { + } else if (algorithm == PROTECTION_ALG_CCMP || algorithm == PROTECTION_ALG_CCMP_256) { g_strlcpy(wlan_stats.protection, "CCMP", MAX_PROTECT_LEN); } else { g_strlcpy(wlan_stats.protection, "Unknown", MAX_PROTECT_LEN); @@ -25434,7 +25435,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo, tvb_get_ntohl(tvb, hdr_len + ivlen + len)); add_new_data_source(pinfo, next_tvb, "Decrypted WEP data"); - } else if (algorithm==PROTECTION_ALG_CCMP) { + } else if (algorithm == PROTECTION_ALG_CCMP || algorithm == PROTECTION_ALG_CCMP_256) { add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data"); } else if (algorithm==PROTECTION_ALG_TKIP) { add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data"); @@ -26448,6 +26449,10 @@ try_decrypt(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint len, *sec_header=DOT11DECRYPT_RSNA_HEADER; *sec_trailer=DOT11DECRYPT_CCMP_TRAILER; break; + case DOT11DECRYPT_KEY_TYPE_CCMP_256: + *sec_header = DOT11DECRYPT_RSNA_HEADER; + *sec_trailer = DOT11DECRYPT_CCMP_256_TRAILER; + break; case DOT11DECRYPT_KEY_TYPE_TKIP: *sec_header=DOT11DECRYPT_RSNA_HEADER; *sec_trailer=DOT11DECRYPT_TKIP_TRAILER; |