aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2018-04-20 06:49:20 -0400
committerJohannes Berg <johannes.berg@intel.com>2018-05-07 10:04:02 -0400
commit407879b690ba3a6bf29be896d02dad63463bd1c0 (patch)
tree473bcb5c490a3bc16a3108c43b2881cd8d040edb
parentd1361b32e6aec7440c01d5c8fcc54189930a342d (diff)
mac80211: Adjust SAE authentication timeout
The IEEE P802.11-REVmd D1.0 specification updated the SAE authentication timeout to be 2000 milliseconds (see dot11RSNASAERetransPeriod). Update the SAE timeout setting accordingly. While at it, reduce some code duplication in the timeout configuration. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/mlme.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 6fe72ef182a1..233068756502 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -36,6 +36,7 @@
36#define IEEE80211_AUTH_TIMEOUT (HZ / 5) 36#define IEEE80211_AUTH_TIMEOUT (HZ / 5)
37#define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2) 37#define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2)
38#define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10) 38#define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10)
39#define IEEE80211_AUTH_TIMEOUT_SAE (HZ * 2)
39#define IEEE80211_AUTH_MAX_TRIES 3 40#define IEEE80211_AUTH_MAX_TRIES 3
40#define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5) 41#define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5)
41#define IEEE80211_ASSOC_TIMEOUT (HZ / 5) 42#define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
@@ -3814,16 +3815,19 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
3814 tx_flags); 3815 tx_flags);
3815 3816
3816 if (tx_flags == 0) { 3817 if (tx_flags == 0) {
3817 auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; 3818 if (auth_data->algorithm == WLAN_AUTH_SAE)
3818 auth_data->timeout_started = true; 3819 auth_data->timeout = jiffies +
3819 run_again(sdata, auth_data->timeout); 3820 IEEE80211_AUTH_TIMEOUT_SAE;
3821 else
3822 auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
3820 } else { 3823 } else {
3821 auth_data->timeout = 3824 auth_data->timeout =
3822 round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG); 3825 round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG);
3823 auth_data->timeout_started = true;
3824 run_again(sdata, auth_data->timeout);
3825 } 3826 }
3826 3827
3828 auth_data->timeout_started = true;
3829 run_again(sdata, auth_data->timeout);
3830
3827 return 0; 3831 return 0;
3828} 3832}
3829 3833
@@ -3894,8 +3898,15 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
3894 ifmgd->status_received = false; 3898 ifmgd->status_received = false;
3895 if (ifmgd->auth_data && ieee80211_is_auth(fc)) { 3899 if (ifmgd->auth_data && ieee80211_is_auth(fc)) {
3896 if (status_acked) { 3900 if (status_acked) {
3897 ifmgd->auth_data->timeout = 3901 if (ifmgd->auth_data->algorithm ==
3898 jiffies + IEEE80211_AUTH_TIMEOUT_SHORT; 3902 WLAN_AUTH_SAE)
3903 ifmgd->auth_data->timeout =
3904 jiffies +
3905 IEEE80211_AUTH_TIMEOUT_SAE;
3906 else
3907 ifmgd->auth_data->timeout =
3908 jiffies +
3909 IEEE80211_AUTH_TIMEOUT_SHORT;
3899 run_again(sdata, ifmgd->auth_data->timeout); 3910 run_again(sdata, ifmgd->auth_data->timeout);
3900 } else { 3911 } else {
3901 ifmgd->auth_data->timeout = jiffies - 1; 3912 ifmgd->auth_data->timeout = jiffies - 1;