diff options
author | Jouni Malinen <j@w1.fi> | 2012-06-27 18:28:13 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-06-27 21:22:12 +0300 |
commit | 4e0131d3512acc67eff02ffa07fd1c0fea2fd3f4 (patch) | |
tree | e432f27be0156ff119e8fe34f1edbe3b1d0223f8 /src/wps/wps_attr_parse.c | |
parent | 582143e5440c59ca3c0f97e4e2fe73a0af8750ee (diff) | |
download | external_wpa_supplicant_8_ti-4e0131d3512acc67eff02ffa07fd1c0fea2fd3f4.zip external_wpa_supplicant_8_ti-4e0131d3512acc67eff02ffa07fd1c0fea2fd3f4.tar.gz external_wpa_supplicant_8_ti-4e0131d3512acc67eff02ffa07fd1c0fea2fd3f4.tar.bz2 |
WPS: Add support for OOB dev password lengths 16..31
Previously, only the maximum length 32 octets for OOB device password
was accepted. Since the specification allows a shorter password to be
used with limited OOB mechanism (e.g., small NFC tag), we should accept
lengths 16..32.
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/wps/wps_attr_parse.c')
-rw-r--r-- | src/wps/wps_attr_parse.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wps/wps_attr_parse.c b/src/wps/wps_attr_parse.c index f5ad403..d0d1efb 100644 --- a/src/wps/wps_attr_parse.c +++ b/src/wps/wps_attr_parse.c @@ -262,12 +262,16 @@ static int wps_set_attr(struct wps_parse_attr *attr, u16 type, attr->dev_password_id = pos; break; case ATTR_OOB_DEVICE_PASSWORD: - if (len != WPS_OOB_DEVICE_PASSWORD_ATTR_LEN) { + if (len < WPS_OOB_PUBKEY_HASH_LEN + 2 + + WPS_OOB_DEVICE_PASSWORD_MIN_LEN || + len > WPS_OOB_PUBKEY_HASH_LEN + 2 + + WPS_OOB_DEVICE_PASSWORD_LEN) { wpa_printf(MSG_DEBUG, "WPS: Invalid OOB Device " "Password length %u", len); return -1; } attr->oob_dev_password = pos; + attr->oob_dev_password_len = len; break; case ATTR_OS_VERSION: if (len != 4) { |