summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2016-08-10 15:43:17 -0700
committergitbuildkicker <android-build@google.com>2016-08-25 21:56:19 -0700
commit1d6c0efc202a21942321ffa3b83b7c9309e66c9a (patch)
tree357ae3316cf071f05d3c74c2a1b89fd529527ccc
parentc998deb9376eea9289d81ac03b41e01722c8a761 (diff)
downloadframeworks_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)
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java4
-rw-r--r--services/core/java/com/android/server/LockSettingsService.java6
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() {