keystore: fix upgrades

During an upgrade, a blob would be written out to disk. Whenever a blob
is written to disk, it is encrypted in-place. After upgrade, keystore
would attempt to use the blob, but get garbage instead of what it
expected since it was encrypted.

This moves the work of writing up a level so it can then re-read the
blob after upgrade.

(cherry picked from commit cfeae072c96d84f286ddbf0aff8055c12c7c4f15)

Bug: 7249554
Change-Id: I1be5ecafa6d39fdcce10d9d3623f23440cac8c6e
1 file changed
tree: bcccc7411e3d1597b9fa8c71c85c92c8e33af1e3
  1. keystore/
  2. keystore-engine/
  3. softkeymaster/