aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/sta.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-05-15 09:40:02 (GMT)
committerJouni Malinen <j@w1.fi>2014-05-15 13:56:59 (GMT)
commitf6ff5160f024b3e632260e657fe076702d98ffb5 (patch)
tree6801360e9a38657fa60c197126f322461ee6c5cb /wlantest/sta.c
parent84a40841779f3a606c3c4c09ee0d584059a7abcf (diff)
downloadhostap-f6ff5160f024b3e632260e657fe076702d98ffb5.zip
hostap-f6ff5160f024b3e632260e657fe076702d98ffb5.tar.gz
hostap-f6ff5160f024b3e632260e657fe076702d98ffb5.tar.bz2
wlantest: Add support for OSEN
This allows Hotspot 2.0 OSEN connection to be analyzed more conveniently. The frames from an OSEN association can now be decrypted using an MSK file. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wlantest/sta.c')
-rw-r--r--wlantest/sta.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/wlantest/sta.c b/wlantest/sta.c
index 115ef8a..6f6178d 100644
--- a/wlantest/sta.c
+++ b/wlantest/sta.c
@@ -82,6 +82,14 @@ void sta_update_assoc(struct wlantest_sta *sta, struct ieee802_11_elems *elems)
elems->rsn_ie = NULL;
}
+ if (elems->osen && !bss->osenie[0]) {
+ wpa_printf(MSG_INFO, "OSEN IE included in Association Request "
+ "frame from " MACSTR " even though BSS does not "
+ "use OSEN - ignore IE",
+ MAC2STR(sta->addr));
+ elems->osen = NULL;
+ }
+
if (elems->wpa_ie && elems->rsn_ie) {
wpa_printf(MSG_INFO, "Both WPA IE and RSN IE included in "
"Association Request frame from " MACSTR,
@@ -108,6 +116,15 @@ void sta_update_assoc(struct wlantest_sta *sta, struct ieee802_11_elems *elems)
wpa_printf(MSG_INFO, "Failed to parse WPA IE from "
MACSTR, MAC2STR(sta->addr));
}
+ } else if (elems->osen) {
+ wpa_hexdump(MSG_DEBUG, "OSEN IE", elems->osen - 2,
+ elems->osen_len + 2);
+ os_memcpy(sta->osenie, elems->osen - 2, elems->osen_len + 2);
+ sta->proto = WPA_PROTO_OSEN;
+ sta->pairwise_cipher = WPA_CIPHER_CCMP;
+ sta->key_mgmt = WPA_KEY_MGMT_OSEN;
+ sta->rsn_capab = 0;
+ goto skip_rsn_wpa;
} else {
sta->rsnie[0] = 0;
sta->proto = 0;
@@ -151,14 +168,15 @@ void sta_update_assoc(struct wlantest_sta *sta, struct ieee802_11_elems *elems)
skip_rsn_wpa:
wpa_printf(MSG_INFO, "STA " MACSTR
- " proto=%s%s%s"
+ " proto=%s%s%s%s"
"pairwise=%s%s%s%s"
- "key_mgmt=%s%s%s%s%s%s%s%s"
+ "key_mgmt=%s%s%s%s%s%s%s%s%s"
"rsn_capab=%s%s%s%s%s",
MAC2STR(sta->addr),
sta->proto == 0 ? "OPEN " : "",
sta->proto & WPA_PROTO_WPA ? "WPA " : "",
sta->proto & WPA_PROTO_RSN ? "WPA2 " : "",
+ sta->proto & WPA_PROTO_OSEN ? "OSEN " : "",
sta->pairwise_cipher == 0 ? "N/A " : "",
sta->pairwise_cipher & WPA_CIPHER_NONE ? "NONE " : "",
sta->pairwise_cipher & WPA_CIPHER_TKIP ? "TKIP " : "",
@@ -173,6 +191,7 @@ skip_rsn_wpa:
"EAP-SHA256 " : "",
sta->key_mgmt & WPA_KEY_MGMT_PSK_SHA256 ?
"PSK-SHA256 " : "",
+ sta->key_mgmt & WPA_KEY_MGMT_OSEN ? "OSEN " : "",
sta->rsn_capab & WPA_CAPABILITY_PREAUTH ? "PREAUTH " : "",
sta->rsn_capab & WPA_CAPABILITY_NO_PAIRWISE ?
"NO_PAIRWISE " : "",