Don\'t fail if the CE key isn\'t loaded in destroy_user_key am: 71ee662

am: 2761664

* commit '2761664e57974663722fdf6f4253add09cc31a9b':
  Don't fail if the CE key isn't loaded in destroy_user_key

Change-Id: I57c6333b4f7cdd45111e7353c6eba2f9fbbbca9f
gugelfrei
Paul Crowley 8 years ago committed by android-build-merger
commit 2f0643158d

@ -443,7 +443,10 @@ bool e4crypt_destroy_user_key(userid_t user_id) {
bool success = true;
s_ce_keys.erase(user_id);
std::string raw_ref;
success &= lookup_key_ref(s_ce_key_raw_refs, user_id, &raw_ref) && evict_key(raw_ref);
// If we haven't loaded the CE key, no need to evict it.
if (lookup_key_ref(s_ce_key_raw_refs, user_id, &raw_ref)) {
success &= evict_key(raw_ref);
}
s_ce_key_raw_refs.erase(user_id);
success &= lookup_key_ref(s_de_key_raw_refs, user_id, &raw_ref) && evict_key(raw_ref);
s_de_key_raw_refs.erase(user_id);

Loading…
Cancel
Save