Skip creating password data file for unsecured users
As another optimization, skip creating the "password data" file in the LSKF-based protector when the LSKF is empty. When the LSKF is empty, the password data file is unnecessary except for providing the scrypt salt and parameters. However, since scrypt provides no security benefit when the LSKF is empty, we can instead just skip the scrypt step. This saves creating one file, which can be somewhat expensive due to the use of synchronous writes and an fsync of the parent directory. It also saves the scrypt operation (albeit with the minimum parameters) and the random salt generation. Bug: 232452368 Bug: 251131631 Bug: 251147505 Test: atest com.android.server.locksettings Change-Id: Ifdc0d507b81cc4b877d1177fb9c31dbff84cdbb0
Loading
Please register or sign in to comment