aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/hs20_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-07-26 19:12:37 (GMT)
committerJouni Malinen <j@w1.fi>2014-02-25 23:24:23 (GMT)
commit7ef6947993d4b09dea6797b96f34dbcfed57d90e (patch)
tree39104ed23bbca21f3c962dc36334c74a962bfa92 /wpa_supplicant/hs20_supplicant.c
parent95a3ea9426180feeaa47498b5a0f89e2de59bc95 (diff)
downloadhostap-7ef6947993d4b09dea6797b96f34dbcfed57d90e.zip
hostap-7ef6947993d4b09dea6797b96f34dbcfed57d90e.tar.gz
hostap-7ef6947993d4b09dea6797b96f34dbcfed57d90e.tar.bz2
HS 2.0R2: Add STA support for Deauthentication Request notification
If requested, disable the network based on the HS 2.0 deauthentication request. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/hs20_supplicant.c')
-rw-r--r--wpa_supplicant/hs20_supplicant.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c
index d419ffb..456ba61 100644
--- a/wpa_supplicant/hs20_supplicant.c
+++ b/wpa_supplicant/hs20_supplicant.c
@@ -14,10 +14,12 @@
#include "common/ieee802_11_defs.h"
#include "common/gas.h"
#include "common/wpa_ctrl.h"
+#include "rsn_supp/wpa.h"
#include "wpa_supplicant_i.h"
#include "driver_i.h"
#include "config.h"
#include "bss.h"
+#include "blacklist.h"
#include "gas_query.h"
#include "interworking.h"
#include "hs20_supplicant.h"
@@ -246,3 +248,33 @@ void hs20_rx_subscription_remediation(struct wpa_supplicant *wpa_s,
else
wpa_msg(wpa_s, MSG_INFO, HS20_SUBSCRIPTION_REMEDIATION);
}
+
+
+void hs20_rx_deauth_imminent_notice(struct wpa_supplicant *wpa_s, u8 code,
+ u16 reauth_delay, const char *url)
+{
+ if (!wpa_sm_pmf_enabled(wpa_s->wpa)) {
+ wpa_printf(MSG_DEBUG, "HS 2.0: Ignore deauthentication imminent notice since PMF was not enabled");
+ return;
+ }
+
+ wpa_msg(wpa_s, MSG_INFO, HS20_DEAUTH_IMMINENT_NOTICE "%u %u %s",
+ code, reauth_delay, url);
+
+ if (code == HS20_DEAUTH_REASON_CODE_BSS) {
+ wpa_printf(MSG_DEBUG, "HS 2.0: Add BSS to blacklist");
+ wpa_blacklist_add(wpa_s, wpa_s->bssid);
+ }
+
+ if (code == HS20_DEAUTH_REASON_CODE_ESS && wpa_s->current_ssid) {
+ struct os_time now;
+ os_get_time(&now);
+ if (now.sec + reauth_delay <=
+ wpa_s->current_ssid->disabled_until.sec)
+ return;
+ wpa_printf(MSG_DEBUG, "HS 2.0: Disable network for %u seconds",
+ reauth_delay);
+ wpa_s->current_ssid->disabled_until.sec =
+ now.sec + reauth_delay;
+ }
+}