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

Commit 5a8d72f1 authored by Eric Biggers's avatar Eric Biggers Committed by Android (Google) Code Review
Browse files

Merge "Stop recognizing legacy password hashes" into main

parents 0d491d3d 686e213f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -66,6 +66,13 @@ flag {
    bug: "395976735"
}

flag {
    name: "stop_recognizing_legacy_password_hashes"
    namespace: "security"
    description: "Make LockSettingsService stop recognizing legacy password hashes"
    bug: "442877927"
}

flag {
    name: "frp_enforcement"
    is_exported: true
+8 −2
Original line number Diff line number Diff line
@@ -602,10 +602,16 @@ public class LockPatternUtils {
        String[] history = passwordHistory.split(PASSWORD_HISTORY_DELIMITER);
        // Password History may be too long...
        for (int i = 0; i < Math.min(passwordHistoryLength, history.length); i++) {
            if (android.security.Flags.stopRecognizingLegacyPasswordHashes()) {
                if (history[i].equals(passwordHash)) {
                    return true;
                }
            } else {
                if (history[i].equals(legacyHash) || history[i].equals(passwordHash)) {
                    return true;
                }
            }
        }
        return false;
    }