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

View File

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

View File

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