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

Commit 2dde840b authored by Eric Biggers's avatar Eric Biggers Committed by Automerger Merge Worker
Browse files

locksettings: zero-pad IDs when shown as hex am: 540914fe

parents 8d997a9b 540914fe
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -2958,7 +2958,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        synchronized (mSpManager) {
            disableEscrowTokenOnNonManagedDevicesIfNeeded(userId);
            for (long handle : mSpManager.getPendingTokensForUser(userId)) {
                Slog.i(TAG, TextUtils.formatSimple("activateEscrowTokens: %x %d ", handle, userId));
                Slogf.i(TAG, "activateEscrowTokens: %016x %d", handle, userId);
                mSpManager.createTokenBasedProtector(handle, sp, userId);
            }
        }
@@ -3121,14 +3121,15 @@ public class LockSettingsService extends ILockSettings.Stub {
            pw.println("User " + userId);
            pw.increaseIndent();
            synchronized (mSpManager) {
                pw.println(TextUtils.formatSimple("LSKF-based SP protector ID: %x",
                pw.println(TextUtils.formatSimple("LSKF-based SP protector ID: %016x",
                        getCurrentLskfBasedProtectorId(userId)));
                pw.println(TextUtils.formatSimple("LSKF last changed: %s (previous protector: %x)",
                pw.println(TextUtils.formatSimple(
                            "LSKF last changed: %s (previous protector: %016x)",
                            timestampToString(getLong(LSKF_LAST_CHANGED_TIME_KEY, 0, userId)),
                            getLong(PREV_LSKF_BASED_PROTECTOR_ID_KEY, 0, userId)));
            }
            try {
                pw.println(TextUtils.formatSimple("SID: %x",
                pw.println(TextUtils.formatSimple("SID: %016x",
                        getGateKeeperService().getSecureUserId(userId)));
            } catch (RemoteException e) {
                // ignore.
+3 −0
Original line number Diff line number Diff line
@@ -1658,6 +1658,9 @@ class SyntheticPasswordManager {
    }

    private String getProtectorKeyAlias(long protectorId) {
        // Note, this arguably has a bug: %x should be %016x so that the protector ID is left-padded
        // with zeroes, like how the synthetic password state files are named.  It's too late to fix
        // this, though, and it doesn't actually matter.
        return TextUtils.formatSimple("%s%x", PROTECTOR_KEY_ALIAS_PREFIX, protectorId);
    }