Encryption: try wrapped key if the first time decryption fails

Change-Id: I108b7aeea41c6b85c851f40c1c4a7e25012e2463
This commit is contained in:
bigbiff bigbiff
2019-09-01 13:38:44 -04:00
parent 05cd3f8616
commit 0be03b3217
3 changed files with 13 additions and 6 deletions
+8 -1
View File
@@ -296,7 +296,14 @@ int TWPartitionManager::Process_Fstab(string Fstab_Filename, bool Display_Error)
while (!Decrypt_Data->Mount(false) && --retry_count)
usleep(500);
if (Decrypt_Data->Mount(false)) {
Decrypt_Data->Decrypt_FBE_DE();
if (!Decrypt_Data->Decrypt_FBE_DE()) {
LOGINFO("Trying wrapped key.\n");
property_set("fbe.data.wrappedkey", "true");
if (!Decrypt_Data->Decrypt_FBE_DE()) {
LOGERR("Unable to decrypt FBE device\n");
}
}
} else {
LOGINFO("Failed to mount data after metadata decrypt\n");
}