diff options
author | Jim Miller <jaggies@google.com> | 2016-08-10 15:43:17 -0700 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2016-08-26 16:21:52 -0700 |
commit | ae3aef22e808bdc87ae7104ab4ae878ada9ed2ef (patch) | |
tree | 7996d02d74c6389e2800052d2497c98ae09c9da8 | |
parent | 00fad46e542f8d358ffc17bab9ce042687d85623 (diff) | |
download | frameworks_base-ae3aef22e808bdc87ae7104ab4ae878ada9ed2ef.zip frameworks_base-ae3aef22e808bdc87ae7104ab4ae878ada9ed2ef.tar.gz frameworks_base-ae3aef22e808bdc87ae7104ab4ae878ada9ed2ef.tar.bz2 |
Fix vulnerability in LockSettings service
Fixes bug 30003944
Change-Id: I8700d4424c6186c8d5e71d2fdede0223ad86904d
(cherry picked from commit 2d71384a139ae27cbc7b57f06662bf6ee2010f2b)
-rw-r--r-- | core/java/com/android/internal/widget/LockPatternUtils.java | 4 | ||||
-rw-r--r-- | services/core/java/com/android/server/LockSettingsService.java | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 60380fb..0aef320 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -291,7 +291,7 @@ public class LockPatternUtils { return false; } } catch (RemoteException re) { - return true; + return false; } } @@ -340,7 +340,7 @@ public class LockPatternUtils { return false; } } catch (RemoteException re) { - return true; + return false; } } 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() { |