Check crypto footer before offering to decrypt

Verify that we have a valid footer with proper magic before
setting things up for decryption to help prevent user confusion
when dealing with data partitions that fail to mount. Also check
to make sure that the block device for /data is present.

Change-Id: Ie87818fe4505a8bf71df7d3934c114e7328ef3ca
This commit is contained in:
Ethan Yonker
2014-02-26 13:36:08 -06:00
parent c62b34c3ba
commit 71413f4ee9
6 changed files with 88 additions and 13 deletions
+3 -3
View File
@@ -1383,9 +1383,9 @@ int TWPartitionManager::Decrypt_Device(string Password) {
property_set("ro.crypto.keyfile.userdata", CRYPTO_KEY_LOC);
#ifdef CRYPTO_SD_FS_TYPE
property_set("ro.crypto.sd_fs_type", CRYPTO_SD_FS_TYPE);
property_set("ro.crypto.sd_fs_real_blkdev", CRYPTO_SD_REAL_BLKDEV);
property_set("ro.crypto.sd_fs_mnt_point", EXPAND(TW_INTERNAL_STORAGE_PATH));
property_set("ro.crypto.sd_fs_type", CRYPTO_SD_FS_TYPE);
property_set("ro.crypto.sd_fs_real_blkdev", CRYPTO_SD_REAL_BLKDEV);
property_set("ro.crypto.sd_fs_mnt_point", EXPAND(TW_INTERNAL_STORAGE_PATH));
#endif
property_set("rw.km_fips_status", "ready");