From 933828251d862bc24b888d247a1cb13573e7232b Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Thu, 1 Nov 2018 15:25:31 -0500 Subject: Add metadata decrypt support for FBE Change-Id: Ie0292f4ffea5993a4ae74fa04fc5c8252ca2cfcf --- partitions.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'partitions.hpp') diff --git a/partitions.hpp b/partitions.hpp index 094c718de..a8fd70b40 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 @@ public: 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 @@ private: 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; -- cgit v1.2.3