Skip to content

Commit

Permalink
system: vold: Use wrapped key for metadata encryption
Browse files Browse the repository at this point in the history
Wrapped key feature is needed for better security of encryption keys and to
ensure data integrity when crypto key cache is cleared during reset operation
of storage/crypto hardware.

Original patch: https://source.codeaurora.org/quic/la/platform/system/vold/commit/?h=LA.QSSI.11.0.r1-05600-qssi.0&id=c480f913e6abc2757c0d79afba5a3df1c4adc731
[Pig]: Clean up all deprecated codes that were removed during latter
merge.

CRs-Fixed: 2367150
Change-Id: I83d14861bf81e102151fa3417d84008c214a9ac0
  • Loading branch information
Neeraj Soni authored and Maitreya29 committed Jan 5, 2022
1 parent bc7515b commit 7872bb6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions FsCrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ static bool get_volume_file_encryption_options(EncryptionOptions* options) {
return true;
}

bool is_metadata_wrapped_key_supported() {
return GetEntryForMountPoint(&fstab_default, METADATA_MNT_POINT)->fs_mgr_flags.wrapped_key;
}

static bool read_and_install_user_ce_key(userid_t user_id,
const android::vold::KeyAuthentication& auth) {
if (s_ce_policies.count(user_id) != 0) return true;
Expand Down
1 change: 1 addition & 0 deletions FsCrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ bool fscrypt_prepare_user_storage(const std::string& volume_uuid, userid_t user_
bool fscrypt_destroy_user_storage(const std::string& volume_uuid, userid_t user_id, int flags);

bool fscrypt_destroy_volume_keys(const std::string& volume_uuid);
bool is_metadata_wrapped_key_supported();
1 change: 1 addition & 0 deletions VoldUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
extern android::fs_mgr::Fstab fstab_default;

#define DATA_MNT_POINT "/data"
#define METADATA_MNT_POINT "/metadata"

0 comments on commit 7872bb6

Please sign in to comment.