WPS: Do not allow Label and Display config methods to be enabled
authorJouni Malinen <jouni.malinen@atheros.com>
Sun, 18 Jul 2010 03:30:49 +0000 (20:30 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 18 Jul 2010 03:30:49 +0000 (20:30 -0700)
It is unclear which PIN is used if both Label and Display config
methods are advertised. Avoid this by not allowing such configuration.

wpa_supplicant/wps_supplicant.c

index db615f6..92296fc 100644 (file)
@@ -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) {