aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-07-18 03:30:49 (GMT)
committerJouni Malinen <j@w1.fi>2010-07-18 03:30:49 (GMT)
commit979b988ed62a5c01e5cbb389de70d7ffcb4c1f2e (patch)
tree6ba84875ef988d6906ac2bcb4453bee1e7a527eb /wpa_supplicant/wps_supplicant.c
parent4436274bef6d73227979c7ca5c87c25e323298b7 (diff)
downloadhostap-979b988ed62a5c01e5cbb389de70d7ffcb4c1f2e.zip
hostap-979b988ed62a5c01e5cbb389de70d7ffcb4c1f2e.tar.gz
hostap-979b988ed62a5c01e5cbb389de70d7ffcb4c1f2e.tar.bz2
WPS: Do not allow Label and Display config methods to be enabled
It is unclear which PIN is used if both Label and Display config methods are advertised. Avoid this by not allowing such configuration.
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index db615f6..92296fc 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -861,6 +861,13 @@ int wpas_wps_init(struct wpa_supplicant *wpa_s)
wps->dev.serial_number = wpa_s->conf->serial_number;
wps->config_methods =
wps_config_methods_str2bin(wpa_s->conf->config_methods);
+ if ((wps->config_methods & (WPS_CONFIG_DISPLAY | WPS_CONFIG_LABEL)) ==
+ (WPS_CONFIG_DISPLAY | WPS_CONFIG_LABEL)) {
+ wpa_printf(MSG_ERROR, "WPS: Both Label and Display config "
+ "methods are not allowed at the same time");
+ os_free(wps);
+ return -1;
+ }
if (wpa_s->conf->device_type &&
wps_dev_type_str2bin(wpa_s->conf->device_type,
wps->dev.pri_dev_type) < 0) {