WPS: Fix OOB Device Password use in PSK1,PSK1 derivation

WSC specification 2.0 section 7.4 describes OOB password to be expressed
in ASCII format (upper case hexdump) instead of raw binary.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-02-24 10:57:49 +02:00 committed by Jouni Malinen
parent f23ce1f032
commit d8ed3a075a
3 changed files with 16 additions and 13 deletions

View file

@ -137,7 +137,6 @@ 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];
int nfc = 0;
wps = sm->wps;
@ -186,14 +185,6 @@ 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;
}
if (cfg.pin_len == 6 &&
os_strncmp((const char *) cfg.pin, "nfc-pw", 6) == 0) {
cfg.pin = NULL;