Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 813f32c9 authored by Eric Biggers's avatar Eric Biggers
Browse files

Add and use PasswordMetrics#validateCredential()

Add a method PasswordMetrics#validateCredential() which takes a
LockscreenCredential argument and honors the "invalid chars" flag in it.
This should be used instead of PasswordMetrics#validatePassword() which
does not honor the "invalid chars" flag (which it does not have access
to) and only works for PASSWORD and PIN, not PATTERN and NONE.

Convert all callers of validatePassword() in frameworks/base to use
validateCredential().  After this, two callers remain: one in
packages/apps/Settings which I'll convert right away too, and several in
packages/apps/Car/Settings which will take a bit longer to get rid of.

Bug: 219511761
Bug: 232900169
Bug: 243881358
Test: atest PasswordMetricsTest
Test: Verified that 'locksettings set-password' no longer accepts
      a non-ASCII char that was accepted before
Test: see I5f1822a34688473cb103eb64dca56e4c19d4dd08
Change-Id: Ib8f43aef5b5aa5bb059780707582d0419f9ddf9a
parent d984e5fd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment