Give all users SP-based credentials
Make it so that every user gets a synthetic password (SP). Previously, users only got an SP if an LSKF or escrow token was set at least once. For normally created users, create the SP by making UserManagerService call the new method LSS.createNewUser(), just after the prerequisite steps of createUserKey and prepareUserData. As this now results in the allocation of LSS state (e.g. a Weaver slot) before the user is fully created, LSS can no longer rely on ACTION_USER_REMOVED for cleaning up its state, so instead make UserManagerService.destroyUserState() call LSS.removeUser(). Note that ACTION_USER_REMOVED isn't sent for pre-created users, so as a side effect this change also fixes a bug where LSS state for pre-created users wasn't removed immediately. For the system user, which doesn't go through the normal user creation flow, make LSS create the SP upon PHASE_BOOT_COMPLETED. At the same time, also create SPs for any other users who don't have one yet; this handles users that were created by older versions of Android. This change makes things more consistent. It is also a prerequisite to making it so that a Weaver value is always needed to unlock the CE key if the device supports Weaver; this is important since Weaver may be the only available securely erasable storage. A later CL will implement this by making the CE key be always bound to the SP. For now, the CE key remains unlockable separately from the SP when there is no LSKF. Test: see Ia753ea21bbaca8ef7a90c03fe73b66c896b1536e Bug: 232452368 Change-Id: Ic82084fe9d9bb34ee9640dea027963043afca9c2
Loading
Please register or sign in to comment