3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

eap-md5: Memzero copies of secrets

This commit is contained in:
Andrew Zaborowski 2019-03-19 01:25:27 +01:00 committed by Denis Kenzior
parent 8954c62bcf
commit c682847249

View File

@ -41,6 +41,9 @@ static void eap_md5_free(struct eap_state *eap)
eap_set_data(eap, NULL);
if (md5->secret)
explicit_bzero(md5->secret, strlen(md5->secret));
l_free(md5->secret);
l_free(md5);
}
@ -126,6 +129,7 @@ static int eap_md5_check_settings(struct l_settings *settings,
password = l_settings_get_string(settings, "Security",
password_key_old);
if (password) {
explicit_bzero(password, strlen(password));
l_warn("Setting '%s' is deprecated, use '%s' instead",
password_key_old, password_key);
return 0;
@ -139,7 +143,8 @@ static int eap_md5_check_settings(struct l_settings *settings,
eap_append_secret(out_missing, EAP_SECRET_REMOTE_PASSWORD,
password_key, NULL, identity,
EAP_CACHE_TEMPORARY);
}
} else
explicit_bzero(password, strlen(password));
return 0;
}