summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2016-08-10 15:43:17 -0700
committergitbuildkicker <android-build@google.com>2016-08-26 16:21:52 -0700
commitae3aef22e808bdc87ae7104ab4ae878ada9ed2ef (patch)
tree7996d02d74c6389e2800052d2497c98ae09c9da8 /services
parent00fad46e542f8d358ffc17bab9ce042687d85623 (diff)
downloadframeworks_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)
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/LockSettingsService.java6
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() {