-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: John Crispin <[email protected]>
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 */ |