From 7e3a67514f6afa45a90b0857921202d0384996e3 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 1 Nov 2009 20:57:36 +0200 Subject: [PATCH] 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. --- src/wps/wps_registrar.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c index cfe63aeb5..6f0806450 100644 --- a/src/wps/wps_registrar.c +++ b/src/wps/wps_registrar.c @@ -1305,14 +1305,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) || @@ -2013,6 +2014,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,