Lines Matching refs:volume_uuid
639 for (const auto& [volume_uuid, policy] : policies.adoptable) { in evict_user_keys()
640 success &= android::vold::evictKey(BuildDataPath(volume_uuid), policy); in evict_user_keys()
688 static std::string volkey_path(const std::string& misc_path, const std::string& volume_uuid) { in volkey_path() argument
689 return misc_path + "/vold/volume_keys/" + volume_uuid + "/default"; in volkey_path()
692 static std::string volume_secdiscardable_path(const std::string& volume_uuid) { in volume_secdiscardable_path() argument
693 return systemwide_volume_key_dir + "/" + volume_uuid + "/secdiscardable"; in volume_secdiscardable_path()
696 static bool read_or_create_volkey(const std::string& misc_path, const std::string& volume_uuid, in read_or_create_volkey() argument
698 auto secdiscardable_path = volume_secdiscardable_path(volume_uuid); in read_or_create_volkey()
708 auto key_path = volkey_path(misc_path, volume_uuid); in read_or_create_volkey()
717 if (!install_storage_key(BuildDataPath(volume_uuid), options, key, policy)) return false; in read_or_create_volkey()
718 user_policies.adoptable[volume_uuid] = *policy; in read_or_create_volkey()
722 static bool destroy_volkey(const std::string& misc_path, const std::string& volume_uuid) { in destroy_volkey() argument
723 auto path = volkey_path(misc_path, volume_uuid); in destroy_volkey()
858 static bool prepare_subdirs(const std::string& action, const std::string& volume_uuid, in prepare_subdirs() argument
861 std::vector<std::string>{prepare_subdirs_path, action, volume_uuid, in prepare_subdirs()
869 bool fscrypt_prepare_user_storage(const std::string& volume_uuid, userid_t user_id, int flags) { in fscrypt_prepare_user_storage() argument
870 LOG(DEBUG) << "fscrypt_prepare_user_storage for volume " << escape_empty(volume_uuid) in fscrypt_prepare_user_storage()
875 if (!volume_uuid.empty()) { in fscrypt_prepare_user_storage()
879 << volume_uuid << " before internal storage"; in fscrypt_prepare_user_storage()
885 << volume_uuid << " before internal storage"; in fscrypt_prepare_user_storage()
898 auto misc_de_path = android::vold::BuildDataMiscDePath(volume_uuid, user_id); in fscrypt_prepare_user_storage()
900 auto user_de_path = android::vold::BuildDataUserDePath(volume_uuid, user_id); in fscrypt_prepare_user_storage()
909 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
913 if (!read_or_create_volkey(misc_de_empty_volume_path, volume_uuid, user_de_policies, in fscrypt_prepare_user_storage()
920 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
940 auto misc_ce_path = android::vold::BuildDataMiscCePath(volume_uuid, user_id); in fscrypt_prepare_user_storage()
942 auto media_ce_path = android::vold::BuildDataMediaCePath(volume_uuid, user_id); in fscrypt_prepare_user_storage()
943 auto user_ce_path = android::vold::BuildDataUserCePath(volume_uuid, user_id); in fscrypt_prepare_user_storage()
952 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
956 if (!read_or_create_volkey(misc_ce_empty_volume_path, volume_uuid, user_ce_policies, in fscrypt_prepare_user_storage()
963 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
984 if (volume_uuid.empty()) { in fscrypt_prepare_user_storage()
993 if (!prepare_subdirs("prepare", volume_uuid, user_id, flags)) return false; in fscrypt_prepare_user_storage()
998 bool fscrypt_destroy_user_storage(const std::string& volume_uuid, userid_t user_id, int flags) { in fscrypt_destroy_user_storage() argument
999 LOG(DEBUG) << "fscrypt_destroy_user_storage for volume " << escape_empty(volume_uuid) in fscrypt_destroy_user_storage()
1003 res &= prepare_subdirs("destroy", volume_uuid, user_id, flags); in fscrypt_destroy_user_storage()
1008 auto misc_ce_path = android::vold::BuildDataMiscCePath(volume_uuid, user_id); in fscrypt_destroy_user_storage()
1010 auto media_ce_path = android::vold::BuildDataMediaCePath(volume_uuid, user_id); in fscrypt_destroy_user_storage()
1011 auto user_ce_path = android::vold::BuildDataUserCePath(volume_uuid, user_id); in fscrypt_destroy_user_storage()
1016 if (volume_uuid.empty()) { in fscrypt_destroy_user_storage()
1022 res &= destroy_volkey(misc_ce_empty_volume_path, volume_uuid); in fscrypt_destroy_user_storage()
1034 auto misc_de_path = android::vold::BuildDataMiscDePath(volume_uuid, user_id); in fscrypt_destroy_user_storage()
1036 auto user_de_path = android::vold::BuildDataUserDePath(volume_uuid, user_id); in fscrypt_destroy_user_storage()
1040 if (volume_uuid.empty()) { in fscrypt_destroy_user_storage()
1048 res &= destroy_volkey(misc_de_empty_volume_path, volume_uuid); in fscrypt_destroy_user_storage()
1056 static bool destroy_volume_keys(const std::string& directory_path, const std::string& volume_uuid) { in destroy_volume_keys() argument
1078 res &= destroy_volkey(directory_path + "/" + entry->d_name, volume_uuid); in destroy_volume_keys()
1084 const std::string& volume_uuid) { in erase_volume_policies() argument
1086 user_policies.adoptable.erase(volume_uuid); in erase_volume_policies()
1092 bool fscrypt_destroy_volume_keys(const std::string& volume_uuid) { in fscrypt_destroy_volume_keys() argument
1095 LOG(DEBUG) << "fscrypt_destroy_volume_keys for volume " << escape_empty(volume_uuid); in fscrypt_destroy_volume_keys()
1096 auto secdiscardable_path = volume_secdiscardable_path(volume_uuid); in fscrypt_destroy_volume_keys()
1098 res &= destroy_volume_keys("/data/misc_ce", volume_uuid); in fscrypt_destroy_volume_keys()
1099 res &= destroy_volume_keys("/data/misc_de", volume_uuid); in fscrypt_destroy_volume_keys()
1103 erase_volume_policies(s_ce_policies, volume_uuid); in fscrypt_destroy_volume_keys()
1104 erase_volume_policies(s_de_policies, volume_uuid); in fscrypt_destroy_volume_keys()