From c0228607f340461e2e0448fabbba32756d1c2807 Mon Sep 17 00:00:00 2001 From: bigbiff Date: Tue, 26 Oct 2021 18:01:00 -0400 Subject: [PATCH] checkpoint: check checkpoint instead of assuming Change-Id: I51ea28759b85db5192117420685774147550947b --- crypto/fscrypt/MetadataCrypt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/fscrypt/MetadataCrypt.cpp b/crypto/fscrypt/MetadataCrypt.cpp index 853e81eb..e9b19672 100755 --- a/crypto/fscrypt/MetadataCrypt.cpp +++ b/crypto/fscrypt/MetadataCrypt.cpp @@ -174,7 +174,7 @@ static bool read_key(const std::string& metadata_key_dir, const KeyGeneration& g unlink(newKeyPath.c_str()); } bool needs_cp = cp_needsCheckpoint(); - if (!retrieveOrGenerateKey(dir, temp, kEmptyAuthentication, gen, key, true)) return false; + if (!retrieveOrGenerateKey(dir, temp, kEmptyAuthentication, gen, key, needs_cp)) return false; if (needs_cp && pathExists(newKeyPath)) std::thread(commit_key, dir).detach(); return true; }