aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-06-27 21:15:29 +0300
committerJouni Malinen <j@w1.fi>2012-06-27 21:22:12 +0300
commit0965813640dadd233e0c35e1f5b48c05397b61f0 (patch)
tree723f93535ec03a25a31bb03c623fa1b453ca1ca3 /src/eap_peer
parent4e0131d3512acc67eff02ffa07fd1c0fea2fd3f4 (diff)
downloadexternal_wpa_supplicant_8_ti-0965813640dadd233e0c35e1f5b48c05397b61f0.zip
external_wpa_supplicant_8_ti-0965813640dadd233e0c35e1f5b48c05397b61f0.tar.gz
external_wpa_supplicant_8_ti-0965813640dadd233e0c35e1f5b48c05397b61f0.tar.bz2
WPS: Fix OOB Device Password use for EAP-WSC peer
The OOB Device Password is passed in as a hexdump of the real Device Password (16..32 octets of arbitrary binary data). The hexdump needs to be converted to binary form before passing it for WPS processing. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_peer')
-rw-r--r--src/eap_peer/eap_wsc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/eap_peer/eap_wsc.c b/src/eap_peer/eap_wsc.c
index 4473b90..2c948a0 100644
--- a/src/eap_peer/eap_wsc.c
+++ b/src/eap_peer/eap_wsc.c
@@ -1,6 +1,6 @@
/*
* EAP-WSC peer for Wi-Fi Protected Setup
- * Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2007-2009, 2012, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
@@ -137,6 +137,7 @@ static void * eap_wsc_init(struct eap_sm *sm)
struct wps_context *wps;
struct wps_credential new_ap_settings;
int res;
+ u8 dev_pw[WPS_OOB_DEVICE_PASSWORD_LEN];
wps = sm->wps;
if (wps == NULL) {
@@ -184,6 +185,14 @@ static void * eap_wsc_init(struct eap_sm *sm)
while (*pos != '\0' && *pos != ' ')
pos++;
cfg.pin_len = pos - (const char *) cfg.pin;
+ if (cfg.pin_len >= WPS_OOB_DEVICE_PASSWORD_MIN_LEN * 2 &&
+ cfg.pin_len <= WPS_OOB_DEVICE_PASSWORD_LEN * 2 &&
+ hexstr2bin((const char *) cfg.pin, dev_pw,
+ cfg.pin_len / 2) == 0) {
+ /* Convert OOB Device Password to binary */
+ cfg.pin = dev_pw;
+ cfg.pin_len /= 2;
+ }
} else {
pos = os_strstr(phase1, "pbc=1");
if (pos)