vold: Enable legacy support for wrapped key

Legacy wrapped key support was dropped while merging changes
to support multiple versions of dm-default key driver in kernel.
Fix this by calling legacy API to check wrapped key support for
metadata encryption.

CRs-Fixed: 2678344
Change-Id: I7d9efec09ddf7169cf0b1114b4e16b9fe38cad4b
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
This commit is contained in:
Neeraj Soni 2020-05-04 23:49:03 +05:30 committed by zlewchan
parent 21091bbe41
commit e955745ae2

View file

@ -36,6 +36,7 @@
#include "Checkpoint.h" #include "Checkpoint.h"
#include "CryptoType.h" #include "CryptoType.h"
#include "EncryptInplace.h" #include "EncryptInplace.h"
#include "FsCrypt.h"
#include "KeyStorage.h" #include "KeyStorage.h"
#include "KeyUtil.h" #include "KeyUtil.h"
#include "Keystore.h" #include "Keystore.h"
@ -281,6 +282,8 @@ bool fscrypt_mount_metadata_encrypted(const std::string& blk_device, const std::
} }
options.cipher = legacy_aes_256_xts; options.cipher = legacy_aes_256_xts;
options.use_legacy_options_format = true; 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); options.set_dun = android::base::GetBoolProperty("ro.crypto.set_dun", false);
if (!options.set_dun && data_rec->fs_mgr_flags.checkpoint_blk) { if (!options.set_dun && data_rec->fs_mgr_flags.checkpoint_blk) {
LOG(ERROR) LOG(ERROR)