diff --git a/src/eap_peer/eap_wsc.c b/src/eap_peer/eap_wsc.c index 2c948a046..d007a5708 100644 --- a/src/eap_peer/eap_wsc.c +++ b/src/eap_peer/eap_wsc.c @@ -138,6 +138,7 @@ static void * eap_wsc_init(struct eap_sm *sm) struct wps_credential new_ap_settings; int res; u8 dev_pw[WPS_OOB_DEVICE_PASSWORD_LEN]; + int nfc = 0; wps = sm->wps; if (wps == NULL) { @@ -193,13 +194,18 @@ 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) { + cfg.pin = NULL; + cfg.pin_len = 0; + nfc = 1; + } } else { pos = os_strstr(phase1, "pbc=1"); if (pos) cfg.pbc = 1; } - if (cfg.pin == NULL && !cfg.pbc) { + if (cfg.pin == NULL && !cfg.pbc && !nfc) { wpa_printf(MSG_INFO, "EAP-WSC: PIN or PBC not set in phase1 " "configuration data"); os_free(data); diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index 95739f4f9..393c3955d 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -1897,21 +1897,13 @@ static int wpas_wps_use_cred(struct wpa_supplicant *wpa_s, } -#ifdef CONFIG_WPS_ER static int wpas_wps_add_nfc_password_token(struct wpa_supplicant *wpa_s, struct wps_parse_attr *attr) { - if (wpa_s->wps_er == NULL) { - wpa_printf(MSG_DEBUG, "WPS: Ignore NFC password token while " - "ER functionality is disabled"); - return -1; - } - return wps_registrar_add_nfc_password_token( wpa_s->wps->registrar, attr->oob_dev_password, attr->oob_dev_password_len); } -#endif /* CONFIG_WPS_ER */ static int wpas_wps_nfc_tag_process(struct wpa_supplicant *wpa_s,