aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-06-28 19:41:26 +0300
committerJouni Malinen <j@w1.fi>2012-06-28 19:41:26 +0300
commite484e927a6754557599d07b84944a748e77ef85c (patch)
treea5ae2e1f7a49745f66bdb92c17cf2e910a620b02 /src/eap_peer
parente6ea2a451c8a0fcc60690b4114d21b0e09218c11 (diff)
downloadexternal_wpa_supplicant_8_ti-e484e927a6754557599d07b84944a748e77ef85c.zip
external_wpa_supplicant_8_ti-e484e927a6754557599d07b84944a748e77ef85c.tar.gz
external_wpa_supplicant_8_ti-e484e927a6754557599d07b84944a748e77ef85c.tar.bz2
WPS: Allow NFC password token from AP to be used with wps_reg
The AP PIN on wps_reg command can now be replaced with special value "nfc-pw" to use device password from a NFC password token from the AP. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_peer')
-rw-r--r--src/eap_peer/eap_wsc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/eap_peer/eap_wsc.c b/src/eap_peer/eap_wsc.c
index 2c948a0..d007a57 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);