Keystore 2.0: Don't use DB unconditionally in generate_key()
The global DB can only be initialized after /data is mounted, so we can't
access it before /data is mounted. In particular, generate_key() was
accessing DB unconditionally to handle key attestation, which won't work
once keystore2 starts before /data is mounted.
This patch makes generate_key() directly handle the case when we have a
Domain::BLOB key with no attestation key to avoid initializing DB.
Bug: 181910578
Test: Make keystore2 boot early and call generate_key from vold
before /data is mounted
Change-Id: I6c61caab681ce462e52cfa497ea699abc6aa3984
1 file changed