3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-01 23:59:51 +01:00

eap-mschapv2: Drop unneeded UTF-8 validation

As report by Denis those strings have already gone through validation.
This commit is contained in:
Andrew Zaborowski 2018-06-14 03:45:26 +02:00 committed by Denis Kenzior
parent 66e332fd4a
commit b9aaab9c63

View File

@ -634,9 +634,6 @@ err:
static bool set_password_from_string(struct eap_mschapv2_state *state, static bool set_password_from_string(struct eap_mschapv2_state *state,
const char *password) const char *password)
{ {
if (!l_utf8_validate(password, strlen(password), NULL))
return false;
return mschapv2_nt_password_hash(password, state->password_hash); return mschapv2_nt_password_hash(password, state->password_hash);
} }
@ -728,11 +725,6 @@ static int eap_mschapv2_check_settings(struct l_settings *settings,
password = l_strdup(secret->value); password = l_strdup(secret->value);
validate: validate:
if (!l_utf8_validate(password, strlen(password), NULL)) {
l_error("Password is not valid UTF-8");
return -EINVAL;
}
if (!mschapv2_nt_password_hash(password, hash)) if (!mschapv2_nt_password_hash(password, hash))
return -EINVAL; return -EINVAL;