aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-11-17 18:35:11 -0800
committerGuy Harris <guy@alum.mit.edu>2016-11-18 02:35:54 +0000
commit08e15a8f43200c76ee45bc20000d5b8d6679ae1f (patch)
tree9bf963d1c970b52b9a800a9467f2ce9b6fa2b808 /epan
parent50515b9ebf8db7e97369e0cdbc748db9d0fd818b (diff)
Don't assume we have a protocol tree.
In the association_sanity_check_t structure: Have separate flags to indicate whether we *have* an IE specifying an FT AKM suite and whether we *have* an IE specifying a non-FT AKM suite. Use those to decide whether to add an expert info, so we add it regardless of whether we are building a protocol tree or not. Set the protocol tree item for the first FT AKM suite and the first non-FT AKM suite only if we have a protocol tree. Bug: 13149 Change-Id: I16a3194017b34d8d2c9128364c2761d1c202969d Reviewed-on: https://code.wireshark.org/review/18863 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ieee80211.c12
-rw-r--r--epan/dissectors/packet-ieee80211.h4
2 files changed, 10 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index ed4b6e2ff1..563cd6caa2 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -10622,12 +10622,14 @@ dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
guint32 akm_suite = tvb_get_ntohl(tvb, offset);
if (akm_suite == 0x000FAC03 || akm_suite == 0x000FAC04 || akm_suite == 0x000FAC09) {
/* This is an FT AKM suite */
- if (association_sanity_check->rsn_first_ft_akm_suite == NULL) {
+ association_sanity_check->has_ft_akm_suite = TRUE;
+ if (association_sanity_check->rsn_first_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
association_sanity_check->rsn_first_ft_akm_suite = rsn_sub_akms_tree->last_child;
}
} else {
/* This is a non-FT AKM suite */
- if (association_sanity_check->rsn_first_non_ft_akm_suite == NULL) {
+ association_sanity_check->has_non_ft_akm_suite = TRUE;
+ if (association_sanity_check->rsn_first_non_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
association_sanity_check->rsn_first_non_ft_akm_suite = rsn_sub_akms_tree->last_child;
}
}
@@ -11082,7 +11084,7 @@ dissect_mobility_domain(proto_tree *tree, tvbuff_t *tvb, int offset,
guint32 tag_len, association_sanity_check_t *association_sanity_check)
{
if (association_sanity_check != NULL) {
- association_sanity_check->association_has_mobility_domain_element = 1;
+ association_sanity_check->association_has_mobility_domain_element = TRUE;
}
if (tag_len < 3) {
@@ -16139,13 +16141,13 @@ ieee_80211_do_association_sanity_check(packet_info *pinfo, association_sanity_ch
if (sanity_check->association_has_mobility_domain_element) {
/* This is an FT association, warn about any non-FT AKM suites */
- if (sanity_check->rsn_first_non_ft_akm_suite != NULL) {
+ if (sanity_check->has_non_ft_akm_suite) {
expert_add_info_format(pinfo, sanity_check->rsn_first_non_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
"Non-FT AKM suite is prohibited for FT association request");
}
} else {
/* This is a non-FT association, warn about any FT AKM suites */
- if (sanity_check->rsn_first_ft_akm_suite != NULL) {
+ if (sanity_check->has_ft_akm_suite) {
expert_add_info_format(pinfo, sanity_check->rsn_first_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
"FT AKM suite is prohibited for non-FT association request");
}
diff --git a/epan/dissectors/packet-ieee80211.h b/epan/dissectors/packet-ieee80211.h
index f983038b81..54eb5b4ff2 100644
--- a/epan/dissectors/packet-ieee80211.h
+++ b/epan/dissectors/packet-ieee80211.h
@@ -32,7 +32,9 @@ extern "C" {
#endif /* __cplusplus */
typedef struct {
- int association_has_mobility_domain_element;
+ gboolean association_has_mobility_domain_element;
+ gboolean has_ft_akm_suite;
+ gboolean has_non_ft_akm_suite;
proto_node *rsn_first_ft_akm_suite;
proto_node *rsn_first_non_ft_akm_suite;
} association_sanity_check_t;