]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Fix wps_reg nfc-pw option
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 14 Feb 2013 17:44:54 +0000 (19:44 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 14 Feb 2013 17:44:54 +0000 (19:44 +0200)
Commit ffdaa05a6b1b59c4b2e50f9b7fef82769fc2d3fe added support for using
NFC password token from an AP. However, it had a bug that prevented the
wpa_supplicant wps_reg command from being used with "nfc-pw" as the PIN
value. Fix string comparison to handle this correctly.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/eap_peer/eap_wsc.c

index d007a57082b53136c34103996d2e0624f8418eb2..f3581560e43041839ac479a4ae342f4a1370edd4 100644 (file)
@@ -194,7 +194,8 @@ static void * eap_wsc_init(struct eap_sm *sm)
                        cfg.pin = dev_pw;
                        cfg.pin_len /= 2;
                }
-               if (cfg.pin_len == 6 && os_strncmp(pos, "nfc-pw", 6) == 0) {
+               if (cfg.pin_len == 6 &&
+                   os_strncmp((const char *) cfg.pin, "nfc-pw", 6) == 0) {
                        cfg.pin = NULL;
                        cfg.pin_len = 0;
                        nfc = 1;