aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/interworking.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-01-30 05:34:47 (GMT)
committerJouni Malinen <j@w1.fi>2013-10-18 11:13:45 (GMT)
commitf47c145285f9d349d527672bdc116f5a9fe4867b (patch)
tree7a3f55258fc48edf813f8a7ca394635ffaf4a274 /wpa_supplicant/interworking.c
parenta83e5749ac5a5ac9224ece79ccfb260bd8a228da (diff)
downloadhostap-f47c145285f9d349d527672bdc116f5a9fe4867b.zip
hostap-f47c145285f9d349d527672bdc116f5a9fe4867b.tar.gz
hostap-f47c145285f9d349d527672bdc116f5a9fe4867b.tar.bz2
Interworking: Add required_roaming_consortium parameter for credentials
This allows credentials to be limited from being used to connect to a network unless the AP advertises a matching roaming consortium OI. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/interworking.c')
-rw-r--r--wpa_supplicant/interworking.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index c296386..666e786 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -112,6 +112,8 @@ static int cred_with_roaming_consortium(struct wpa_supplicant *wpa_s)
for (cred = wpa_s->conf->cred; cred; cred = cred->next) {
if (cred->roaming_consortium_len)
return 1;
+ if (cred->required_roaming_consortium_len)
+ return 1;
}
return 0;
}
@@ -944,6 +946,27 @@ static int roaming_consortium_match(const u8 *ie, const struct wpabuf *anqp,
}
+static int cred_no_required_oi_match(struct wpa_cred *cred, struct wpa_bss *bss)
+{
+ const u8 *ie;
+
+ if (cred->required_roaming_consortium_len == 0)
+ return 0;
+
+ ie = wpa_bss_get_ie(bss, WLAN_EID_ROAMING_CONSORTIUM);
+
+ if (ie == NULL &&
+ (bss->anqp == NULL || bss->anqp->roaming_consortium == NULL))
+ return 1;
+
+ return !roaming_consortium_match(ie,
+ bss->anqp ?
+ bss->anqp->roaming_consortium : NULL,
+ cred->required_roaming_consortium,
+ cred->required_roaming_consortium_len);
+}
+
+
static int cred_excluded_ssid(struct wpa_cred *cred, struct wpa_bss *bss)
{
size_t i;
@@ -991,6 +1014,8 @@ static struct wpa_cred * interworking_credentials_available_roaming_consortium(
if (cred_excluded_ssid(cred, bss))
continue;
+ if (cred_no_required_oi_match(cred, bss))
+ continue;
if (selected == NULL ||
selected->priority < cred->priority)
@@ -1409,6 +1434,8 @@ static struct wpa_cred * interworking_credentials_available_3gpp(
if (ret) {
if (cred_excluded_ssid(cred, bss))
continue;
+ if (cred_no_required_oi_match(cred, bss))
+ continue;
if (selected == NULL ||
selected->priority < cred->priority)
selected = cred;
@@ -1451,6 +1478,8 @@ static struct wpa_cred * interworking_credentials_available_realm(
if (nai_realm_find_eap(cred, &realm[i])) {
if (cred_excluded_ssid(cred, bss))
continue;
+ if (cred_no_required_oi_match(cred, bss))
+ continue;
if (selected == NULL ||
selected->priority < cred->priority)
selected = cred;