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

Commit 1cd2160c authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Use CHALLENGE_NONE when VerifyCredential invoked with challenge=0

LSS should generate a challenge if VerifyCredential is invoked
without a challenge. Otherwise, biometric lockout reset will not
work properly.

Bug: 153921881

Test: BiometricPromptDemo, allow device credential, enter password.
      Notice the added log, as well as generateChallenge, resetLockout,
      and revokeChallenge working now.
Change-Id: I0d24afa8b77f0b92b301c1ae53c3e6e8991a1335
(cherry picked from commit 3db0369f)
parent 0a64cfbb
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1972,7 +1972,13 @@ public class LockSettingsService extends ILockSettings.Stub {
    public VerifyCredentialResponse verifyCredential(LockscreenCredential credential,
            long challenge, int userId) {
        checkPasswordReadPermission(userId);
        return doVerifyCredential(credential, CHALLENGE_FROM_CALLER, challenge, userId,
        @ChallengeType int challengeType = CHALLENGE_FROM_CALLER;
        if (challenge == 0) {
            Slog.w(TAG, "VerifyCredential called with challenge=0");
            challengeType = CHALLENGE_NONE;

        }
        return doVerifyCredential(credential, challengeType, challenge, userId,
                null /* progressCallback */);
    }