From 0be03b3217cc60944b60f6ba65dabcffd411e138 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Tue, 27 Aug 2019 20:50:31 -0400 Subject: Encryption: try wrapped key if the first time decryption fails Change-Id: I108b7aeea41c6b85c851f40c1c4a7e25012e2463 --- partitionmanager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'partitionmanager.cpp') diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 85dc79d36..41d8af209 100755 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -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"); } -- cgit v1.2.3