diff options
author | Masashi Honma <honma@ictec.co.jp> | 2009-12-09 23:42:54 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2009-12-09 23:42:54 +0200 |
commit | bab31499fd0883be8614d807daa6e05da2f9f4f8 (patch) | |
tree | aacb480bfa6deb1820f6617e66a4f3bc6646a7eb /src | |
parent | 3484a18a135b20ffbc54f4a9e99daaa560651b4c (diff) | |
download | external_wpa_supplicant_8_ti-bab31499fd0883be8614d807daa6e05da2f9f4f8.zip external_wpa_supplicant_8_ti-bab31499fd0883be8614d807daa6e05da2f9f4f8.tar.gz external_wpa_supplicant_8_ti-bab31499fd0883be8614d807daa6e05da2f9f4f8.tar.bz2 |
EAP-TTLS/PAP: User-Password obfuscation for zero length password
The password in User-Password AVP is padded to a multiple of 16 bytes
on EAP-TTLS/PAP. But when the password length is zero, no padding is
added. It doesn't cause connectivity issue. In fact, I could connect
with hostapd RADIUS server with zero length password.
I think it's better for obfuscation to pad the 16 bytes data when the
password length is zero with this patch.
Diffstat (limited to 'src')
-rw-r--r-- | src/eap_peer/eap_ttls.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eap_peer/eap_ttls.c b/src/eap_peer/eap_ttls.c index 800f1b5..f93ba38 100644 --- a/src/eap_peer/eap_ttls.c +++ b/src/eap_peer/eap_ttls.c @@ -846,7 +846,7 @@ static int eap_ttls_phase2_request_pap(struct eap_sm *sm, /* User-Password; in RADIUS, this is encrypted, but EAP-TTLS encrypts * the data, so no separate encryption is used in the AVP itself. * However, the password is padded to obfuscate its length. */ - pad = (16 - (password_len & 15)) & 15; + pad = password_len == 0 ? 16 : (16 - (password_len & 15)) & 15; pos = eap_ttls_avp_hdr(pos, RADIUS_ATTR_USER_PASSWORD, 0, 1, password_len + pad); os_memcpy(pos, password, password_len); |