]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Allow Device Password Id changes between PIN methods
authorJouni Malinen <j@w1.fi>
Mon, 27 May 2013 21:35:47 +0000 (00:35 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 27 May 2013 21:35:47 +0000 (00:35 +0300)
Commit b4a17a6ea74b2ffba082e05c84730e979513042c added support for the
WPS Registrar to change the Device Password based on WSC specification
design. However, this added validation for Registrar behavior which
resulted in preventing a common P2P use case from working. Relax the
validation rules for builds with P2P enabled to allow the Enrollee (P2P
client) accepting M1/M2 changes in Device Password Id between Default
and Registrar-specified PIN.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/wps/wps_enrollee.c

index 1af43c2d58b0880ff13098cb0ffe66f356545b49..27c554f316e8cd2abf8179fd2cb992281b786a57 100644 (file)
@@ -842,6 +842,24 @@ static int wps_process_dev_pw_id(struct wps_data *wps, const u8 *dev_pw_id)
                return 0;
        }
 
+#ifdef CONFIG_P2P
+       if ((id == DEV_PW_DEFAULT &&
+            wps->dev_pw_id == DEV_PW_REGISTRAR_SPECIFIED) ||
+           (id == DEV_PW_REGISTRAR_SPECIFIED &&
+            wps->dev_pw_id == DEV_PW_DEFAULT)) {
+               /*
+                * Common P2P use cases indicate whether the PIN is from the
+                * client or GO using Device Password Id in M1/M2 in a way that
+                * does not look fully compliant with WSC specification. Anyway,
+                * this is deployed and needs to be allowed, so ignore changes
+                * between Registrar-Specified and Default PIN.
+                */
+               wpa_printf(MSG_DEBUG, "WPS: Allow PIN Device Password ID "
+                          "change");
+               return 0;
+       }
+#endif /* CONFIG_P2P */
+
        wpa_printf(MSG_DEBUG, "WPS: Registrar trying to change Device Password "
                   "ID from %u to %u", wps->dev_pw_id, id);