From 61729d86bab407da02d8eeaac1b8f5893f0ae83b Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 27 Feb 2023 19:20:43 +0000 Subject: [PATCH] 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 --- .../com/android/server/locksettings/LockSettingsService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java index 9a9798dabf794..718a773cacf6e 100644 --- a/services/core/java/com/android/server/locksettings/LockSettingsService.java +++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java @@ -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); }