locksettings: clean up logging of password history updates
Currently the logging for password history updates consists only of the
message "Initialized lock password salt for user". But that's only
logged on the first update, and it's unclear that it's related to the
password history. Let's replace it with a clearer message that is
logged whenever a password is added to the password history.
This doesn't change anything for the case where password history is
disabled, which is the default setting.
Bug: 268526331
Change-Id: Ibe6f679a17b887261711e0fd7da1b62a114ce7e6
Merged-In: Ibe6f679a17b887261711e0fd7da1b62a114ce7e6
(cherry picked from commit 61729d86ba)
This commit is contained in:
@@ -1718,6 +1718,7 @@ public class LockSettingsService extends ILockSettings.Stub {
|
||||
if (passwordHistoryLength == 0) {
|
||||
passwordHistory = "";
|
||||
} else {
|
||||
Slogf.d(TAG, "Adding new password to password history for user %d", userHandle);
|
||||
final byte[] hashFactor = getHashFactor(password, userHandle);
|
||||
final byte[] salt = getSalt(userHandle).getBytes();
|
||||
String hash = password.passwordToHistoryHash(salt, hashFactor);
|
||||
@@ -1749,7 +1750,6 @@ public class LockSettingsService extends ILockSettings.Stub {
|
||||
if (salt == 0) {
|
||||
salt = SecureRandomUtils.randomLong();
|
||||
setLong(LockPatternUtils.LOCK_PASSWORD_SALT_KEY, salt, userId);
|
||||
Slog.v(TAG, "Initialized lock password salt for user: " + userId);
|
||||
}
|
||||
return Long.toHexString(salt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user