Merge "Avoid error message when destroying key w/o secdiscardable file" am: dc262c27f0

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2470460

Change-Id: I0259a28cc469a98149512f258751771f09112fda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Eric Biggers 2023-03-04 06:30:21 +00:00 committed by Automerger Merge Worker
commit 60c71b9950

View file

@ -660,8 +660,11 @@ bool destroyKey(const std::string& dir) {
kSecdiscardPath,
"--",
dir + "/" + kFn_encrypted_key,
dir + "/" + kFn_secdiscardable,
};
auto secdiscardable = dir + "/" + kFn_secdiscardable;
if (pathExists(secdiscardable)) {
secdiscard_cmd.push_back(secdiscardable);
}
// Try each thing, even if previous things failed.
for (auto& fn : {kFn_keymaster_key_blob, kFn_keymaster_key_blob_upgraded}) {