aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-09-05 17:51:11 (GMT)
committerJouni Malinen <j@w1.fi>2015-09-05 17:51:11 (GMT)
commitfaf427645aa79a32ebd8093ff676abfc9d36e951 (patch)
tree329999ddfc0ad1518c681113e5eaf8b47b8feab3 /src
parentdcc8bc82e088b1253f16c2e302b767fb33525db3 (diff)
downloadhostap-faf427645aa79a32ebd8093ff676abfc9d36e951.zip
hostap-faf427645aa79a32ebd8093ff676abfc9d36e951.tar.gz
hostap-faf427645aa79a32ebd8093ff676abfc9d36e951.tar.bz2
TDLS: Use proper IE parsing routine for non-EAPOL-Key cases
wpa_supplicant_parse_ies() was never supposed to be used as a generic IE parser, i.e., it is for the specific purpose of parsing EAPOL-Key Key Data IEs and KDEs. TDLS used this function for parsing generic AP IEs and while that works, it resulted in confusing "WPA: Unrecognized EAPOL-Key Key Data IE" debug messages. Clean this up by using ieee802_11_parse_elems() for the cases where generic IEs are being parsed. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/rsn_supp/tdls.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
index 6b1df71..722c20a 100644
--- a/src/rsn_supp/tdls.c
+++ b/src/rsn_supp/tdls.c
@@ -12,6 +12,7 @@
#include "utils/eloop.h"
#include "utils/os.h"
#include "common/ieee802_11_defs.h"
+#include "common/ieee802_11_common.h"
#include "crypto/sha256.h"
#include "crypto/crypto.h"
#include "crypto/aes_wrap.h"
@@ -2859,14 +2860,14 @@ void wpa_tdls_disassoc(struct wpa_sm *sm)
}
-static int wpa_tdls_prohibited(struct wpa_eapol_ie_parse *elems)
+static int wpa_tdls_prohibited(struct ieee802_11_elems *elems)
{
/* bit 38 - TDLS Prohibited */
return !!(elems->ext_capab[2 + 4] & 0x40);
}
-static int wpa_tdls_chan_switch_prohibited(struct wpa_eapol_ie_parse *elems)
+static int wpa_tdls_chan_switch_prohibited(struct ieee802_11_elems *elems)
{
/* bit 39 - TDLS Channel Switch Prohibited */
return !!(elems->ext_capab[2 + 4] & 0x80);
@@ -2875,12 +2876,13 @@ static int wpa_tdls_chan_switch_prohibited(struct wpa_eapol_ie_parse *elems)
void wpa_tdls_ap_ies(struct wpa_sm *sm, const u8 *ies, size_t len)
{
- struct wpa_eapol_ie_parse elems;
+ struct ieee802_11_elems elems;
sm->tdls_prohibited = 0;
sm->tdls_chan_switch_prohibited = 0;
- if (ies == NULL || wpa_supplicant_parse_ies(ies, len, &elems) < 0 ||
+ if (ies == NULL ||
+ ieee802_11_parse_elems(ies, len, &elems, 0) == ParseFailed ||
elems.ext_capab == NULL || elems.ext_capab_len < 2 + 5)
return;
@@ -2896,9 +2898,10 @@ void wpa_tdls_ap_ies(struct wpa_sm *sm, const u8 *ies, size_t len)
void wpa_tdls_assoc_resp_ies(struct wpa_sm *sm, const u8 *ies, size_t len)
{
- struct wpa_eapol_ie_parse elems;
+ struct ieee802_11_elems elems;
- if (ies == NULL || wpa_supplicant_parse_ies(ies, len, &elems) < 0 ||
+ if (ies == NULL ||
+ ieee802_11_parse_elems(ies, len, &elems, 0) == ParseFailed ||
elems.ext_capab == NULL || elems.ext_capab_len < 2 + 5)
return;