aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-01-08 03:49:36 (GMT)
committerJouni Malinen <j@w1.fi>2008-01-08 03:49:36 (GMT)
commit99d5d2c76790eeb925f7d68f9b6894ae5844c01a (patch)
treea6a43c603e9e8ad1b4647b08446e3e9bcd8ddd0b /hostapd
parent2b47b49506332f24722b2d9f748e7b2c37d1e008 (diff)
downloadhostap-history-99d5d2c76790eeb925f7d68f9b6894ae5844c01a.zip
hostap-history-99d5d2c76790eeb925f7d68f9b6894ae5844c01a.tar.gz
hostap-history-99d5d2c76790eeb925f7d68f9b6894ae5844c01a.tar.bz2
WPS: Added support for setting AP Setup Locked attribute
Since hostapd does not yet support external Registrars, this does not really disable such functionality, but in theory, the current functionality looks more or less the same as a locked setup would look like, so setting ap_setup_locked=1 in configuration is reasonable option for the time being.
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config.c2
-rw-r--r--hostapd/config.h1
-rw-r--r--hostapd/hostapd.conf5
-rw-r--r--hostapd/wps_hostapd.c1
4 files changed, 9 insertions, 0 deletions
diff --git a/hostapd/config.c b/hostapd/config.c
index 2d20d27..f6d953b 100644
--- a/hostapd/config.c
+++ b/hostapd/config.c
@@ -1935,6 +1935,8 @@ struct hostapd_config * hostapd_config_read(const char *fname)
printf("Line %d: invalid wps_state\n", line);
errors++;
}
+ } else if (os_strcmp(buf, "ap_setup_locked") == 0) {
+ bss->ap_setup_locked = atoi(pos);
} else if (os_strcmp(buf, "uuid") == 0) {
if (uuid_str2bin(pos, bss->uuid)) {
printf("Line %d: invalid UUID\n", line);
diff --git a/hostapd/config.h b/hostapd/config.h
index 668e204..0e5a8f0 100644
--- a/hostapd/config.h
+++ b/hostapd/config.h
@@ -265,6 +265,7 @@ struct hostapd_bss_config {
int wps_state;
#ifdef CONFIG_WPS
+ int ap_setup_locked;
u8 uuid[16];
#endif /* CONFIG_WPS */
};
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index c8eeaa1..38821d8 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -768,6 +768,11 @@ own_ip_addr=127.0.0.1
# 2 = WPS enabled, configured
#wps_state=2
+# AP can be configured into a locked state where new WPS Registrar are not
+# accepted, but previously authorized Registrars (including the internal one)
+# can continue to add new Enrollees.
+#ap_setup_locked=1
+
# Universally Unique IDentifier (UUID; see RFC 4122) of the device
# This value is used as the UUID for the internal WPS Registrar. If the AP
# is also using UPnP, this value should be set to the device's UPnP UUID.
diff --git a/hostapd/wps_hostapd.c b/hostapd/wps_hostapd.c
index 3e0ee88..7e27f7c 100644
--- a/hostapd/wps_hostapd.c
+++ b/hostapd/wps_hostapd.c
@@ -137,6 +137,7 @@ int hostapd_init_wps(struct hostapd_data *hapd,
os_memset(&cfg, 0, sizeof(cfg));
cfg.wps_state = hapd->conf->wps_state;
+ cfg.ap_setup_locked = hapd->conf->ap_setup_locked;
cfg.uuid = hapd->conf->uuid;
cfg.ssid = (const u8 *) hapd->conf->ssid.ssid;
cfg.ssid_len = hapd->conf->ssid.ssid_len;