WPS: Use WSC_NACK if no device password is known on M2 RX

This can happen on the AP if the AP PIN is not configured and
the client tries to go through the protocol instead of just using
Registrar mode to receive M1 from the AP. It is cleaner to send
out the WSC_NACK instead of just stopping the protocol.
This commit is contained in:
Jouni Malinen 2010-08-24 12:56:11 +03:00
parent 509a39727f
commit 035cc69d98

View file

@ -782,7 +782,8 @@ static enum wps_process_res wps_process_m2(struct wps_data *wps,
return WPS_CONTINUE;
}
if (wps->wps->ap && wps->wps->ap_setup_locked) {
if (wps->wps->ap &&
(wps->wps->ap_setup_locked || wps->dev_password == NULL)) {
wpa_printf(MSG_DEBUG, "WPS: AP Setup is locked - refuse "
"registration of a new Registrar");
wps->config_error = WPS_CFG_SETUP_LOCKED;