diff options
author | Jim Miller <jaggies@google.com> | 2016-08-10 15:43:17 -0700 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2016-08-25 21:56:19 -0700 |
commit | 1d6c0efc202a21942321ffa3b83b7c9309e66c9a (patch) | |
tree | 357ae3316cf071f05d3c74c2a1b89fd529527ccc /services | |
parent | c998deb9376eea9289d81ac03b41e01722c8a761 (diff) | |
download | frameworks_base-1d6c0efc202a21942321ffa3b83b7c9309e66c9a.zip frameworks_base-1d6c0efc202a21942321ffa3b83b7c9309e66c9a.tar.gz frameworks_base-1d6c0efc202a21942321ffa3b83b7c9309e66c9a.tar.bz2 |
Fix vulnerability in LockSettings service
Fixes bug 30003944
Change-Id: I8700d4424c6186c8d5e71d2fdede0223ad86904d
(cherry picked from commit 2d71384a139ae27cbc7b57f06662bf6ee2010f2b)
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/LockSettingsService.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java index 55682c2..6cb2875 100644 --- a/services/core/java/com/android/server/LockSettingsService.java +++ b/services/core/java/com/android/server/LockSettingsService.java @@ -519,6 +519,9 @@ public class LockSettingsService extends ILockSettings.Stub { private VerifyCredentialResponse doVerifyPattern(String pattern, boolean hasChallenge, long challenge, int userId) throws RemoteException { checkPasswordReadPermission(userId); + if (TextUtils.isEmpty(pattern)) { + throw new IllegalArgumentException("Pattern can't be null or empty"); + } CredentialHash storedHash = mStorage.readPatternHash(userId); boolean shouldReEnrollBaseZero = storedHash != null && storedHash.isBaseZeroPattern; @@ -575,6 +578,9 @@ public class LockSettingsService extends ILockSettings.Stub { private VerifyCredentialResponse doVerifyPassword(String password, boolean hasChallenge, long challenge, int userId) throws RemoteException { checkPasswordReadPermission(userId); + if (TextUtils.isEmpty(password)) { + throw new IllegalArgumentException("Password can't be null or empty"); + } CredentialHash storedHash = mStorage.readPasswordHash(userId); return verifyCredential(userId, storedHash, password, hasChallenge, challenge, new CredentialUtil() { |