WPS: Fix wps_reg command documentation to require BSSID

Replacing the BSSID with 'any' has never worked with wps_reg
command, so better not claim it could work. In addition, reject
this is wpa_supplicant to make it clearer that the operation
fails.
This commit is contained in:
Jouni Malinen 2010-10-25 18:56:49 +03:00 committed by Jouni Malinen
parent 3071e18109
commit 129eb428b1
2 changed files with 6 additions and 8 deletions

View file

@ -334,7 +334,7 @@ static int wpa_supplicant_ctrl_iface_wps_oob(struct wpa_supplicant *wpa_s,
static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s, static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s,
char *cmd) char *cmd)
{ {
u8 bssid[ETH_ALEN], *_bssid = bssid; u8 bssid[ETH_ALEN];
char *pin; char *pin;
char *new_ssid; char *new_ssid;
char *new_auth; char *new_auth;
@ -347,9 +347,7 @@ static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s,
return -1; return -1;
*pin++ = '\0'; *pin++ = '\0';
if (os_strcmp(cmd, "any") == 0) if (hwaddr_aton(cmd, bssid)) {
_bssid = NULL;
else if (hwaddr_aton(cmd, bssid)) {
wpa_printf(MSG_DEBUG, "CTRL_IFACE WPS_REG: invalid BSSID '%s'", wpa_printf(MSG_DEBUG, "CTRL_IFACE WPS_REG: invalid BSSID '%s'",
cmd); cmd);
return -1; return -1;
@ -357,7 +355,7 @@ static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s,
new_ssid = os_strchr(pin, ' '); new_ssid = os_strchr(pin, ' ');
if (new_ssid == NULL) if (new_ssid == NULL)
return wpas_wps_start_reg(wpa_s, _bssid, pin, NULL); return wpas_wps_start_reg(wpa_s, bssid, pin, NULL);
*new_ssid++ = '\0'; *new_ssid++ = '\0';
new_auth = os_strchr(new_ssid, ' '); new_auth = os_strchr(new_ssid, ' ');
@ -380,7 +378,7 @@ static int wpa_supplicant_ctrl_iface_wps_reg(struct wpa_supplicant *wpa_s,
ap.auth = new_auth; ap.auth = new_auth;
ap.encr = new_encr; ap.encr = new_encr;
ap.key_hex = new_key; ap.key_hex = new_key;
return wpas_wps_start_reg(wpa_s, _bssid, pin, &ap); return wpas_wps_start_reg(wpa_s, bssid, pin, &ap);
} }

View file

@ -717,11 +717,11 @@ static int wpa_cli_cmd_wps_reg(struct wpa_ctrl *ctrl, int argc, char *argv[])
key_hex); key_hex);
} else { } else {
printf("Invalid WPS_REG command: need two arguments:\n" printf("Invalid WPS_REG command: need two arguments:\n"
"- BSSID: use 'any' to select any\n" "- BSSID of the target AP\n"
"- AP PIN\n"); "- AP PIN\n");
printf("Alternatively, six arguments can be used to " printf("Alternatively, six arguments can be used to "
"reconfigure the AP:\n" "reconfigure the AP:\n"
"- BSSID: use 'any' to select any\n" "- BSSID of the target AP\n"
"- AP PIN\n" "- AP PIN\n"
"- new SSID\n" "- new SSID\n"
"- new auth (OPEN, WPAPSK, WPA2PSK)\n" "- new auth (OPEN, WPAPSK, WPA2PSK)\n"