aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-11-14 10:55:48 (GMT)
committerJouni Malinen <j@w1.fi>2017-11-14 10:55:48 (GMT)
commit878723b9207b79a2760cdf1baf9ab9fb468cd771 (patch)
tree5926b347107cedbda06c375dfeb6dc23e3e8f6b5
parent5420bcf477d0088fac84cba1d803f89830b6b970 (diff)
downloadhostap-878723b9207b79a2760cdf1baf9ab9fb468cd771.zip
hostap-878723b9207b79a2760cdf1baf9ab9fb468cd771.tar.gz
hostap-878723b9207b79a2760cdf1baf9ab9fb468cd771.tar.bz2
wlantest: Do not ignore RSN/WPA/OSEN element before full BSS info
wlantest used to ignore RSN/WPA/OSEN element in (Re)Association Request frame if no Beacon frame had been seen from the AP before the association exchange. This could result in not being able to derive keys properly. Work around this by skipping that step if the BSS entry is not yet complete. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--wlantest/bss.c1
-rw-r--r--wlantest/sta.c9
-rw-r--r--wlantest/wlantest.h1
3 files changed, 8 insertions, 3 deletions
diff --git a/wlantest/bss.c b/wlantest/bss.c
index 03baf94..04afe2b 100644
--- a/wlantest/bss.c
+++ b/wlantest/bss.c
@@ -223,6 +223,7 @@ void bss_update(struct wlantest *wt, struct wlantest_bss *bss,
if (!update)
return;
+ bss->beacon_seen = 1;
bss->prev_capab_info = bss->capab_info;
bss->proto = 0;
bss->pairwise_cipher = 0;
diff --git a/wlantest/sta.c b/wlantest/sta.c
index 1268b8a..1e53532 100644
--- a/wlantest/sta.c
+++ b/wlantest/sta.c
@@ -66,7 +66,8 @@ void sta_update_assoc(struct wlantest_sta *sta, struct ieee802_11_elems *elems)
struct wpa_ie_data data;
struct wlantest_bss *bss = sta->bss;
- if (elems->wpa_ie && !bss->wpaie[0]) {
+ if (elems->wpa_ie && !bss->wpaie[0] &&
+ (bss->beacon_seen || bss->proberesp_seen)) {
wpa_printf(MSG_INFO, "WPA IE included in Association Request "
"frame from " MACSTR " even though BSS does not "
"use WPA - ignore IE",
@@ -74,7 +75,8 @@ void sta_update_assoc(struct wlantest_sta *sta, struct ieee802_11_elems *elems)
elems->wpa_ie = NULL;
}
- if (elems->rsn_ie && !bss->rsnie[0]) {
+ if (elems->rsn_ie && !bss->rsnie[0] &&
+ (bss->beacon_seen || bss->proberesp_seen)) {
wpa_printf(MSG_INFO, "RSN IE included in Association Request "
"frame from " MACSTR " even though BSS does not "
"use RSN - ignore IE",
@@ -82,7 +84,8 @@ void sta_update_assoc(struct wlantest_sta *sta, struct ieee802_11_elems *elems)
elems->rsn_ie = NULL;
}
- if (elems->osen && !bss->osenie[0]) {
+ if (elems->osen && !bss->osenie[0] &&
+ (bss->beacon_seen || bss->proberesp_seen)) {
wpa_printf(MSG_INFO, "OSEN IE included in Association Request "
"frame from " MACSTR " even though BSS does not "
"use OSEN - ignore IE",
diff --git a/wlantest/wlantest.h b/wlantest/wlantest.h
index 7a99b48..bad005d 100644
--- a/wlantest/wlantest.h
+++ b/wlantest/wlantest.h
@@ -129,6 +129,7 @@ struct wlantest_bss {
u16 prev_capab_info;
u8 ssid[32];
size_t ssid_len;
+ int beacon_seen;
int proberesp_seen;
int parse_error_reported;
u8 wpaie[257];