Loading core/java/com/android/internal/widget/LockPatternUtils.java +0 −13 Original line number Diff line number Diff line Loading @@ -932,19 +932,6 @@ public class LockPatternUtils { return Long.toHexString(salt); } /** * Generate a hash for the given password. To avoid brute force attacks, we use a salted hash. * Not the most secure, but it is at least a second level of protection. First level is that * the file is in a location only readable by the system process. * * @param password the gesture pattern. * * @return the hash of the pattern in a byte array. */ public String legacyPasswordToHash(byte[] password, int userId) { return LockscreenCredential.legacyPasswordToHash(password, getSalt(userId).getBytes()); } /** * Returns the credential type of the user, can be one of {@link #CREDENTIAL_TYPE_NONE}, * {@link #CREDENTIAL_TYPE_PATTERN}, {@link #CREDENTIAL_TYPE_PIN} and Loading services/core/java/com/android/server/locksettings/LockSettingsService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1773,7 +1773,7 @@ public class LockSettingsService extends ILockSettings.Stub { } else { final byte[] hashFactor = getHashFactor(password, userHandle); final byte[] salt = getSalt(userHandle).getBytes(); String hash = password.passwordToHistoryHash(hashFactor, salt); String hash = password.passwordToHistoryHash(salt, hashFactor); if (hash == null) { Slog.e(TAG, "Compute new style password hash failed, fallback to legacy style"); hash = password.legacyPasswordToHash(salt); Loading Loading
core/java/com/android/internal/widget/LockPatternUtils.java +0 −13 Original line number Diff line number Diff line Loading @@ -932,19 +932,6 @@ public class LockPatternUtils { return Long.toHexString(salt); } /** * Generate a hash for the given password. To avoid brute force attacks, we use a salted hash. * Not the most secure, but it is at least a second level of protection. First level is that * the file is in a location only readable by the system process. * * @param password the gesture pattern. * * @return the hash of the pattern in a byte array. */ public String legacyPasswordToHash(byte[] password, int userId) { return LockscreenCredential.legacyPasswordToHash(password, getSalt(userId).getBytes()); } /** * Returns the credential type of the user, can be one of {@link #CREDENTIAL_TYPE_NONE}, * {@link #CREDENTIAL_TYPE_PATTERN}, {@link #CREDENTIAL_TYPE_PIN} and Loading
services/core/java/com/android/server/locksettings/LockSettingsService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1773,7 +1773,7 @@ public class LockSettingsService extends ILockSettings.Stub { } else { final byte[] hashFactor = getHashFactor(password, userHandle); final byte[] salt = getSalt(userHandle).getBytes(); String hash = password.passwordToHistoryHash(hashFactor, salt); String hash = password.passwordToHistoryHash(salt, hashFactor); if (hash == null) { Slog.e(TAG, "Compute new style password hash failed, fallback to legacy style"); hash = password.legacyPasswordToHash(salt); Loading