[PATCH 41/44] FT: convert r0_key_lifetime to seconds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michael Braun <michael-dev@xxxxxxxxxxxxx>

Simplifies testing. All other items are seconds as well.

Signed-off-by: Michael Braun <michael-dev@xxxxxxxxxxxxx>
---
 hostapd/hostapd.conf | 2 +-
 src/ap/ap_config.c   | 2 +-
 src/ap/wpa_auth.c    | 2 +-
 src/ap/wpa_auth_ft.c | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index 53983bb..631f0e0 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -1273,7 +1273,7 @@ own_ip_addr=127.0.0.1
 # 1 to 48 octet identifier.
 # This is configured with nas_identifier (see RADIUS client section above).
 
-# Default lifetime of the PMK-RO in minutes; range 1..65535
+# Default lifetime of the PMK-RO in seconds; range 1..65535
 # (default: 60 minutes; 0 = disable timeout)
 # (dot11FTR0KeyLifetime)
 #r0_key_lifetime=10000
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index c2361e0..2d5961d 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -92,7 +92,7 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
 
 #ifdef CONFIG_IEEE80211R
 	bss->ft_over_ds = 1;
-	bss->r0_key_lifetime = 60; /* same as eap_reauth_period */
+	bss->r0_key_lifetime = 3600; /* same as eap_reauth_period */
 	bss->rkh_pos_timeout = 86400;
 	bss->rkh_neg_timeout = 60;
 	bss->rkh_pull_timeout = 1000;
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 8414335..371ecfb 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -2363,7 +2363,7 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
 		*pos++ = WLAN_EID_TIMEOUT_INTERVAL;
 		*pos++ = 5;
 		*pos++ = WLAN_TIMEOUT_KEY_LIFETIME;
-		WPA_PUT_LE32(pos, conf->r0_key_lifetime * 60);
+		WPA_PUT_LE32(pos, conf->r0_key_lifetime);
 		pos += 4;
 	}
 #endif /* CONFIG_IEEE80211R */
diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c
index beeeca7..07b0b09 100644
--- a/src/ap/wpa_auth_ft.c
+++ b/src/ap/wpa_auth_ft.c
@@ -838,7 +838,7 @@ int wpa_auth_derive_ptk_ft(struct wpa_state_machine *sm, const u8 *pmk,
 	const u8 *ssid = sm->wpa_auth->conf.ssid;
 	size_t ssid_len = sm->wpa_auth->conf.ssid_len;
 	int psk_local = sm->wpa_auth->conf.ft_psk_generate_local;
-	int expiresIn = sm->wpa_auth->conf.r0_key_lifetime * 60;
+	int expiresIn = sm->wpa_auth->conf.r0_key_lifetime;
 	struct ft_vlan vlan;
 	u8 identity[FT_IDENTITY_LEN], radius_cui[FT_RADIUS_CUI_LEN];
 	int identity_len, radius_cui_len;
@@ -2189,7 +2189,7 @@ static int wpa_ft_rrb_rx_resp(struct wpa_authenticator *wpa_auth,
 	struct ft_remote_r0kh *r0kh, *r0kh_wildcard = NULL;
 	int pairwise, res, expiresIn, session_timeout;
 	struct ft_pull_resp_cb_ctx ctx;
-	int maxExpiresIn = wpa_auth->conf.r0_key_lifetime * 60;
+	int maxExpiresIn = wpa_auth->conf.r0_key_lifetime;
 
 	wpa_printf(MSG_DEBUG, "FT: Received PMK-R1 pull response");
 
@@ -2301,7 +2301,7 @@ static int wpa_ft_rrb_rx_push(struct wpa_authenticator *wpa_auth,
 	struct os_time now;
 	os_time_t tsend;
 	int pairwise, expiresIn, session_timeout;
-	int maxExpiresIn = wpa_auth->conf.r0_key_lifetime * 60;
+	int maxExpiresIn = wpa_auth->conf.r0_key_lifetime;
 
 	wpa_printf(MSG_DEBUG, "FT: Received PMK-R1 push");
 
-- 
1.9.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux