[PATCH v2 1/2] wps: reconfigure credentials on reload
Raphaël Mélotte
raphael.melotte at mind.be
Thu Feb 4 10:01:04 EST 2021
When new credentials are configured and hostapd is reconfigured using
SIGHUP (or reload on the ctrl_iface), also update the wps credentials.
Before these changes, when WPS is triggered the registar always serves
the credentials that were configured when hostapd started.
Signed-off-by: Raphaël Mélotte <raphael.melotte at mind.be>
---
Changes v1 -> v2:
- add missing ifdef for CONFIG_WEP
Signed-off-by: Raphaël Mélotte <raphael.melotte at mind.be>
---
src/ap/wps_hostapd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c
index 8b1dad518..ff942a67b 100644
--- a/src/ap/wps_hostapd.c
+++ b/src/ap/wps_hostapd.c
@@ -1471,6 +1471,7 @@ void hostapd_update_wps(struct hostapd_data *hapd)
wpa_snprintf_hex((char *) wps->network_key, 2 * PMK_LEN + 1,
conf->ssid.wpa_psk->psk, PMK_LEN);
wps->network_key_len = 2 * PMK_LEN;
+#ifdef CONFIG_WEP
} else if (conf->ssid.wep.keys_set && conf->ssid.wep.key[0]) {
wps->network_key = os_malloc(conf->ssid.wep.len[0]);
if (wps->network_key == NULL)
@@ -1478,6 +1479,7 @@ void hostapd_update_wps(struct hostapd_data *hapd)
os_memcpy(wps->network_key, conf->ssid.wep.key[0],
conf->ssid.wep.len[0]);
wps->network_key_len = conf->ssid.wep.len[0];
+#endif /* CONFIG_WEP */
}
if (conf->ssid.wpa_psk) {
--
2.29.2
More information about the Hostap
mailing list