mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 09:32:34 +00:00
hostapd: add ft_key easy button
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
55
feeds/ipq807x_v5.4/hostapd/patches/zzz-roaming-key.patch
Normal file
55
feeds/ipq807x_v5.4/hostapd/patches/zzz-roaming-key.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3154,6 +3154,8 @@ static int hostapd_config_fill(struct ho
|
||||
bss->ft_psk_generate_local = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ft_l2_refresh") == 0) {
|
||||
bss->ft_l2_refresh = atoi(pos);
|
||||
+ } else if (os_strcmp(buf, "ft_key") == 0) {
|
||||
+ strncpy(bss->ft_key, pos, sizeof(bss->ft_key));
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
#ifndef CONFIG_NO_CTRL_IFACE
|
||||
} else if (os_strcmp(buf, "ctrl_interface") == 0) {
|
||||
@@ -4996,8 +4998,22 @@ struct hostapd_config * hostapd_config_r
|
||||
|
||||
fclose(f);
|
||||
|
||||
- for (i = 0; i < conf->num_bss; i++)
|
||||
+#define _MACSTR "%02x%02x%02x%02x%02x%02x"
|
||||
+ for (i = 0; i < conf->num_bss; i++) {
|
||||
hostapd_set_security_params(conf->bss[i], 1);
|
||||
+ if (*conf->bss[i]->ft_key) {
|
||||
+ u8 buffer[128];
|
||||
+ sprintf(buffer, MACSTR " " _MACSTR " %s", MAC2STR(conf->bss[i]->bssid), MAC2STR(conf->bss[i]->bssid), conf->bss[i]->ft_key);
|
||||
+ add_r0kh(conf->bss[i], buffer);
|
||||
+ sprintf(buffer, "ff:ff:ff:ff:ff:ff * %s", conf->bss[i]->ft_key);
|
||||
+ add_r0kh(conf->bss[i], buffer);
|
||||
+ sprintf(buffer, MACSTR " " MACSTR " %s", MAC2STR(conf->bss[i]->bssid), MAC2STR(conf->bss[i]->bssid), conf->bss[i]->ft_key);
|
||||
+ add_r1kh(conf->bss[i], buffer);
|
||||
+ sprintf(buffer, "00:00:00:00:00:00 00:00:00:00:00:00 %s", conf->bss[i]->ft_key);
|
||||
+ add_r1kh(conf->bss[i], buffer);
|
||||
+ os_memcpy(conf->bss[i]->r1_key_holder, conf->bss[i]->bssid, 6);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if (hostapd_config_check(conf, 1))
|
||||
errors++;
|
||||
--- a/src/ap/wpa_auth.h
|
||||
+++ b/src/ap/wpa_auth.h
|
||||
@@ -221,6 +221,7 @@ struct wpa_auth_config {
|
||||
int pmk_r1_push;
|
||||
int ft_over_ds;
|
||||
int ft_psk_generate_local;
|
||||
+ u8 ft_key[33];
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
int disable_gtk;
|
||||
int ap_mlme;
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -403,6 +403,7 @@ struct hostapd_bss_config {
|
||||
int ft_psk_generate_local;
|
||||
int ft_l2_refresh;
|
||||
int r1_max_key_lifetime;
|
||||
+ u8 ft_key[33];
|
||||
#endif /* CONFIG_IEEE80211R_AP */
|
||||
|
||||
char *ctrl_interface; /* directory for UNIX domain sockets */
|
||||
Reference in New Issue
Block a user