summaryrefslogtreecommitdiff
path: root/libs/input/PointerController.cpp
diff options
context:
space:
mode:
author Eric Biggers <ebiggers@google.com> 2023-06-21 05:28:10 +0000
committer Eric Biggers <ebiggers@google.com> 2023-10-06 17:03:20 +0000
commit019ec7a6ffa56cf4ee7292e0f1995ec0ecd682bd (patch)
treee09c4f8ee5705c099e5d856dd52ef9e2168fd666 /libs/input/PointerController.cpp
parent8c9ac5c0dc087c6f0f476199649a19e5182a6079 (diff)
Make LockscreenCredential remember whether it has invalid chars
http://ag/6283443 ("Refactor passwords/pins/patterns to byte[]" in packages/apps/Settings), which went into Android 10, introduced a bug where the chars of the lockscreen password are truncated to bytes before the password is validated to contain only ASCII 32–127. This causes characters outside the intended range to be accepted. Specifically, any character U-XXXX where XXXX mod 256 is in 32–127 is accepted and is treated as equivalent to some ASCII character. This reduces the entropy of the password, but also it can make it impossible for the user to unlock the device after rebooting. This happens if the chosen password uses a character that can only be entered on a third-party keyboard (IME) that is not direct boot aware or was uninstalled later. (The potential dependence on a third-party keyboard is one of the reasons that non-ASCII characters were never intended to be allowed in lockscreen passwords in the first place.) Unfortunately, it's likely that some users managed to set a password containing non-ASCII character(s) and are happily using it. To allow fixing this bug without locking out such users, this CL updates LockscreenCredential to keep track of whether it was instantiated using any invalid characters or not, while still keeping the truncation bug in place. Later CLs will use this "invalid chars" flag to reject new passwords that contain any invalid characters. Bug: 219511761 Bug: 232900169 Bug: 243881358 Test: atest LockscreenCredentialTest Test: atest com.android.server.locksettings Change-Id: I5c3c55367c3a294578cd0f97ac0e315a11ed517e Merged-In: I5c3c55367c3a294578cd0f97ac0e315a11ed517e (cherry picked from commit d984e5fd6211e1b23c8847db4912ce89753e3e80)
Diffstat (limited to 'libs/input/PointerController.cpp')
0 files changed, 0 insertions, 0 deletions