keystore2: rename values of UserState enum
Rename UserState::LskfLocked to UserState::BeforeFirstUnlock, and
rename UserState::LskfUnlocked to UserState::AfterFirstUnlock.
This makes it much clearer what these states are. This includes
avoiding the misleading use of "LSKF"; the secret that's actually
relevant is the user's synthetic password, which is most commonly
unlocked with the LSKF but can potentially be unlocked in other ways.
This is also helpful for the planned change to make the user's super
keys exist even while the user doesn't have an LSKF.
Bug: 296464083
Test: atest -p --include-subdirs system/security/keystore2
Test: atest CtsKeystoreTestCases
Flag: exempt, mechanical refactoring and comment changes
Change-Id: I78f15e2165876951c98e22e577fc4c92a3602b3b
diff --git a/keystore2/src/maintenance.rs b/keystore2/src/maintenance.rs
index f25233f..a4cb1fc 100644
--- a/keystore2/src/maintenance.rs
+++ b/keystore2/src/maintenance.rs
@@ -82,7 +82,7 @@
.context(ks_err!("unlock_screen_lock_bound_key failed"))?;
}
- if let UserState::LskfLocked = DB
+ if let UserState::BeforeFirstUnlock = DB
.with(|db| skm.get_user_state(&mut db.borrow_mut(), &LEGACY_IMPORTER, user_id as u32))
.context(ks_err!("Could not get user state while changing password!"))?
{