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

Commit c3ee3641 authored by Eric Biggers's avatar Eric Biggers
Browse files

LockSettingsService: pass SyntheticPassword to unlockKeystore()

Make unlockKeystore() consistent with unlockUserKey() by taking in the
SyntheticPassword instead of the Keystore password directly.  This is a
straightforward refactor.

Bug: 296464083
Test: atest com.android.server.locksettings
Change-Id: I4fe794615240e8a9a9d077dfbe3d693de4ec7f36
parent c5e69730
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1358,8 +1358,8 @@ public class LockSettingsService extends ILockSettings.Stub {
        AndroidKeyStoreMaintenance.onUserPasswordChanged(userHandle, password);
    }

    private void unlockKeystore(byte[] password, int userHandle) {
        Authorization.onLockScreenEvent(false, userHandle, password, null);
    private void unlockKeystore(int userId, SyntheticPassword sp) {
        Authorization.onLockScreenEvent(false, userId, sp.deriveKeyStorePassword(), null);
    }

    @VisibleForTesting /** Note: this method is overridden in unit tests */
@@ -2829,7 +2829,7 @@ public class LockSettingsService extends ILockSettings.Stub {
            }
        }

        unlockKeystore(sp.deriveKeyStorePassword(), userId);
        unlockKeystore(userId, sp);

        unlockUserKey(userId, sp);

@@ -2896,7 +2896,7 @@ public class LockSettingsService extends ILockSettings.Stub {
            mSpManager.clearSidForUser(userId);
            gateKeeperClearSecureUserId(userId);
            unlockUserKey(userId, sp);
            unlockKeystore(sp.deriveKeyStorePassword(), userId);
            unlockKeystore(userId, sp);
            setKeystorePassword(null, userId);
            removeBiometricsForUser(userId);
        }