diff --git a/MetadataCrypt.cpp b/MetadataCrypt.cpp index ca2813d..1920073 100644 --- a/MetadataCrypt.cpp +++ b/MetadataCrypt.cpp @@ -39,6 +39,7 @@ #include "Checkpoint.h" #include "CryptoType.h" #include "EncryptInplace.h" +#include "FsCrypt.h" #include "KeyStorage.h" #include "KeyUtil.h" #include "Keymaster.h" @@ -296,6 +297,8 @@ bool fscrypt_mount_metadata_encrypted(const std::string& blk_device, const std:: } options.cipher = legacy_aes_256_xts; options.use_legacy_options_format = true; + if (is_metadata_wrapped_key_supported()) + options.use_hw_wrapped_key = true; options.set_dun = android::base::GetBoolProperty("ro.crypto.set_dun", false); if (!options.set_dun && data_rec->fs_mgr_flags.checkpoint_blk) { LOG(ERROR)