Add metadata decrypt support for FBE
Change-Id: Ie0292f4ffea5993a4ae74fa04fc5c8252ca2cfcf
diff --git a/partitions.hpp b/partitions.hpp
index 094c718..a8fd70b 100644
--- a/partitions.hpp
+++ b/partitions.hpp
@@ -31,6 +31,23 @@
using namespace std;
+// BasePartition is used for overriding so we can run custom, device
+// specific code.
+class BasePartition {
+ public:
+ explicit BasePartition() {}
+ virtual ~BasePartition() {}
+
+ virtual bool PreWipeEncryption() {
+ return true;
+ }
+
+ virtual bool PostWipeEncryption() {
+ return true;
+ }
+};
+BasePartition* make_partition();
+
struct PartitionList {
std::string Display_Name;
std::string Mount_Point;
@@ -128,6 +145,7 @@
void Partition_Post_Processing(bool Display_Error); // Apply partition specific settings after fstab processed
void Set_Backup_FileName(string fname); // Set Backup_FileName for partition
string Get_Backup_Name(); // Get Backup_Name for partition
+ bool Decrypt_FBE_DE(); // If FBE is present, backup exclusions are set up and DE decrypt is attempted
public:
string Current_File_System; // Current file system
@@ -246,6 +264,7 @@
bool SlotSelect; // Partition has A/B slots
TWExclude backup_exclusions; // Exclusions for file based backups
TWExclude wipe_exclusions; // Exclusions for file based wipes (data/media devices only)
+ string Key_Directory; // Metadata key directory needed for mounting FBE encrypted data partitions using metadata encryption
struct partition_fs_flags_struct { // This struct is used to store mount flags and options for different file systems for the same partition
string File_System;