Skip to content

Commit 1d6c0ef

Browse files
Jim Millergitbuildkicker
authored andcommitted
Fix vulnerability in LockSettings service
Fixes bug 30003944 Change-Id: I8700d4424c6186c8d5e71d2fdede0223ad86904d (cherry picked from commit 2d71384)
1 parent c998deb commit 1d6c0ef

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

core/java/com/android/internal/widget/LockPatternUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public boolean checkPattern(List<LockPatternView.Cell> pattern, int userId)
291291
return false;
292292
}
293293
} catch (RemoteException re) {
294-
return true;
294+
return false;
295295
}
296296
}
297297

@@ -340,7 +340,7 @@ public boolean checkPassword(String password, int userId) throws RequestThrottle
340340
return false;
341341
}
342342
} catch (RemoteException re) {
343-
return true;
343+
return false;
344344
}
345345
}
346346

services/core/java/com/android/server/LockSettingsService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ public VerifyCredentialResponse verifyPattern(String pattern, long challenge, in
519519
private VerifyCredentialResponse doVerifyPattern(String pattern, boolean hasChallenge,
520520
long challenge, int userId) throws RemoteException {
521521
checkPasswordReadPermission(userId);
522+
if (TextUtils.isEmpty(pattern)) {
523+
throw new IllegalArgumentException("Pattern can't be null or empty");
524+
}
522525
CredentialHash storedHash = mStorage.readPatternHash(userId);
523526
boolean shouldReEnrollBaseZero = storedHash != null && storedHash.isBaseZeroPattern;
524527

@@ -575,6 +578,9 @@ public VerifyCredentialResponse verifyPassword(String password, long challenge,
575578
private VerifyCredentialResponse doVerifyPassword(String password, boolean hasChallenge,
576579
long challenge, int userId) throws RemoteException {
577580
checkPasswordReadPermission(userId);
581+
if (TextUtils.isEmpty(password)) {
582+
throw new IllegalArgumentException("Password can't be null or empty");
583+
}
578584
CredentialHash storedHash = mStorage.readPasswordHash(userId);
579585
return verifyCredential(userId, storedHash, password, hasChallenge, challenge,
580586
new CredentialUtil() {

0 commit comments

Comments
 (0)