3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 22:09:38 +01:00

eap: Remove redundant error messages in .load_settings

A method's .check_settings method checks for inconsistent setting files
and prints readable errors so there's no need to do that again in
.load_settings, although at some point after removing the duplicate
error messages from the load_settings methods we agreed to keep minimum
checks that could cause a crash e.g. in a corner case like when the
setting file got modified between the check_settings and the
load_settings call.  Some error messages have been re-added to
load_settings after that (e.g. in
bb4e1ebd4f) but they're incomplete and not
useful so remove them.
This commit is contained in:
Andrew Zaborowski 2019-02-08 18:32:12 +01:00 committed by Denis Kenzior
parent 451a7e9b52
commit d9f0cc47d0
3 changed files with 4 additions and 15 deletions

View File

@ -144,12 +144,9 @@ static bool eap_gtc_load_settings(struct eap_state *eap,
prefix); prefix);
password = l_settings_get_string(settings, "Security", password = l_settings_get_string(settings, "Security",
password_key); password_key);
if (!password)
if (!password) {
l_error("Property '%sPassword' is missing.", prefix);
return false; return false;
} }
}
gtc = l_new(struct eap_gtc_state, 1); gtc = l_new(struct eap_gtc_state, 1);
gtc->password = password; gtc->password = password;

View File

@ -160,12 +160,9 @@ static bool eap_md5_load_settings(struct eap_state *eap,
prefix); prefix);
secret = l_settings_get_string(settings, "Security", secret = l_settings_get_string(settings, "Security",
password_key); password_key);
if (!secret)
if (!secret) {
l_error("Property '%sPassword' is missing.", prefix);
return false; return false;
} }
}
md5 = l_new(struct eap_md5_state, 1); md5 = l_new(struct eap_md5_state, 1);
md5->secret = secret; md5->secret = secret;

View File

@ -545,10 +545,8 @@ static bool eap_mschapv2_load_settings(struct eap_state *eap,
snprintf(setting, sizeof(setting), "%sIdentity", prefix); snprintf(setting, sizeof(setting), "%sIdentity", prefix);
state->user = l_settings_get_string(settings, "Security", setting); state->user = l_settings_get_string(settings, "Security", setting);
if (!state->user) { if (!state->user)
l_error("'%s' setting is missing", setting);
goto error; goto error;
}
state->user_len = strlen(state->user); state->user_len = strlen(state->user);
@ -565,11 +563,8 @@ static bool eap_mschapv2_load_settings(struct eap_state *eap,
snprintf(setting, sizeof(setting), "%sPassword-Hash", prefix); snprintf(setting, sizeof(setting), "%sPassword-Hash", prefix);
hash_str = l_settings_get_value(settings, "Security", setting); hash_str = l_settings_get_value(settings, "Security", setting);
if (!hash_str) { if (!hash_str)
l_error("Neither '%sPassword' or '%sPassword-Hash' "
"setting was provided", prefix, prefix);
goto error; goto error;
}
tmp = l_util_from_hexstring(hash_str, &len); tmp = l_util_from_hexstring(hash_str, &len);
memcpy(state->password_hash, tmp, 16); memcpy(state->password_hash, tmp, 16);