Fix vulnerability in LockSettings service am: 2d71384a13 am: 485fbda04c am: 229de7088e
am: cb83f6188b
Change-Id: I82302931ab714e25ec21721dc05480e1f2d447b0
This commit is contained in:
@@ -354,7 +354,7 @@ public class LockPatternUtils {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,7 +435,7 @@ public class LockPatternUtils {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1215,6 +1215,9 @@ public class LockSettingsService extends ILockSettings.Stub {
|
|||||||
private VerifyCredentialResponse doVerifyPattern(String pattern, boolean hasChallenge,
|
private VerifyCredentialResponse doVerifyPattern(String pattern, boolean hasChallenge,
|
||||||
long challenge, int userId) throws RemoteException {
|
long challenge, int userId) throws RemoteException {
|
||||||
checkPasswordReadPermission(userId);
|
checkPasswordReadPermission(userId);
|
||||||
|
if (TextUtils.isEmpty(pattern)) {
|
||||||
|
throw new IllegalArgumentException("Pattern can't be null or empty");
|
||||||
|
}
|
||||||
CredentialHash storedHash = mStorage.readPatternHash(userId);
|
CredentialHash storedHash = mStorage.readPatternHash(userId);
|
||||||
return doVerifyPattern(pattern, storedHash, hasChallenge, challenge, userId);
|
return doVerifyPattern(pattern, storedHash, hasChallenge, challenge, userId);
|
||||||
}
|
}
|
||||||
@@ -1306,6 +1309,9 @@ public class LockSettingsService extends ILockSettings.Stub {
|
|||||||
private VerifyCredentialResponse doVerifyPassword(String password, boolean hasChallenge,
|
private VerifyCredentialResponse doVerifyPassword(String password, boolean hasChallenge,
|
||||||
long challenge, int userId) throws RemoteException {
|
long challenge, int userId) throws RemoteException {
|
||||||
checkPasswordReadPermission(userId);
|
checkPasswordReadPermission(userId);
|
||||||
|
if (TextUtils.isEmpty(password)) {
|
||||||
|
throw new IllegalArgumentException("Password can't be null or empty");
|
||||||
|
}
|
||||||
CredentialHash storedHash = mStorage.readPasswordHash(userId);
|
CredentialHash storedHash = mStorage.readPasswordHash(userId);
|
||||||
return doVerifyPassword(password, storedHash, hasChallenge, challenge, userId);
|
return doVerifyPassword(password, storedHash, hasChallenge, challenge, userId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user