Commit 8ba4546f authored by xiyuan's avatar xiyuan Committed by Commit bot

cros: Clear secret when it is no longer needed.

BUG=416127

Review URL: https://codereview.chromium.org/589643003

Cr-Commit-Position: refs/heads/master@{#295869}
parent 933aeaf0
...@@ -796,6 +796,7 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) { ...@@ -796,6 +796,7 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) {
delegate_->OnProfilePrepared(profile); delegate_->OnProfilePrepared(profile);
UpdateEasyUnlockKeys(profile); UpdateEasyUnlockKeys(profile);
user_context_.ClearSecrets();
} }
void UserSessionManager::InitSessionRestoreStrategy() { void UserSessionManager::InitSessionRestoreStrategy() {
...@@ -1003,6 +1004,13 @@ void UserSessionManager::UpdateEasyUnlockKeys(Profile* user_profile) { ...@@ -1003,6 +1004,13 @@ void UserSessionManager::UpdateEasyUnlockKeys(Profile* user_profile) {
if (user_context_.GetUserType() != user_manager::USER_TYPE_REGULAR) if (user_context_.GetUserType() != user_manager::USER_TYPE_REGULAR)
return; return;
// Bail if |user_context_| does not have secret.
if (user_context_.GetKey()->GetSecret().empty()) {
// Nagging if this is not crash restore case.
DCHECK(user_sessions_restored_);
return;
}
// |user_context_| and |user_profile| must belong to the same user. // |user_context_| and |user_profile| must belong to the same user.
DCHECK_EQ(SigninManagerFactory::GetForProfile(user_profile) DCHECK_EQ(SigninManagerFactory::GetForProfile(user_profile)
->GetAuthenticatedAccountId(), ->GetAuthenticatedAccountId(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment