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

Commit 54c19b62 authored by Rubin Xu's avatar Rubin Xu
Browse files

Clear Gatekeeper state before a new enrollment

On some devices gatekeeper would fail after certain enrollments due to
some persistent state left around. Call clearSecureUserId() to clear
these state would solve the problem.

Bug: 37704110
Test: execute adb shell cmd lock_settings set-password --old 1234 1234 many times
Change-Id: I0344d6e5bf8b08dd7f1314451bc6d5e3c8c68bab
parent 287578a6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -583,6 +583,9 @@ public class SyntheticPasswordManager {
            sid = GateKeeper.INVALID_SECURE_USER_ID;
            applicationId = transformUnderWeaverSecret(pwdToken, weaverSecret);
        } else {
            // In case GK enrollment leaves persistent state around (in RPMB), this will nuke them
            // to prevent them from accumulating and causing problems.
            gatekeeper.clearSecureUserId(fakeUid(userId));
            // GateKeeper based user password
            GateKeeperResponse response = gatekeeper.enroll(fakeUid(userId), null, null,
                    passwordTokenToGkInput(pwdToken));