aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-11-01 18:57:36 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 19:11:47 (GMT)
commitd0912572d7a0f786e016a4cae1afd550e7af78f8 (patch)
tree2116a52cf35528da5bd0070018eb71c7f76a27b6
parentfea501d7d2faa1a24c99b85d3235c4ab241ea0db (diff)
downloadhostap-06-d0912572d7a0f786e016a4cae1afd550e7af78f8.zip
hostap-06-d0912572d7a0f786e016a4cae1afd550e7af78f8.tar.gz
hostap-06-d0912572d7a0f786e016a4cae1afd550e7af78f8.tar.bz2
WPS: Use Config Error 12 to indicate PBC overlap in M2D
If PBC session overlap is detected between button press on the registrar and M1 is reception, report session overlap with the Config Error attribute in M2D to the Enrollee. (cherry picked from commit 7e3a67514f6afa45a90b0857921202d0384996e3)
-rw-r--r--src/wps/wps_registrar.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c
index a44fda1..31f958e 100644
--- a/src/wps/wps_registrar.c
+++ b/src/wps/wps_registrar.c
@@ -1184,14 +1184,15 @@ static struct wpabuf * wps_build_m2(struct wps_data *wps)
static struct wpabuf * wps_build_m2d(struct wps_data *wps)
{
struct wpabuf *msg;
- u16 err = WPS_CFG_NO_ERROR;
+ u16 err = wps->config_error;
wpa_printf(MSG_DEBUG, "WPS: Building Message M2D");
msg = wpabuf_alloc(1000);
if (msg == NULL)
return NULL;
- if (wps->wps->ap && wps->wps->ap_setup_locked)
+ if (wps->wps->ap && wps->wps->ap_setup_locked &&
+ err == WPS_CFG_NO_ERROR)
err = WPS_CFG_SETUP_LOCKED;
if (wps_build_version(msg) ||
@@ -1865,6 +1866,7 @@ static enum wps_process_res wps_process_m1(struct wps_data *wps,
wpa_printf(MSG_DEBUG, "WPS: PBC overlap - deny PBC "
"negotiation");
wps->state = SEND_M2D;
+ wps->config_error = WPS_CFG_MULTIPLE_PBC_DETECTED;
return WPS_CONTINUE;
}
wps_registrar_add_pbc_session(wps->wps->registrar,