summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiyuan <xiyuan@chromium.org>2014-09-20 06:20:19 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-20 13:20:29 +0000
commit8ba4546fd0922508e212348f19dd2b624290c683 (patch)
tree908c8da8e8ca1a8ce0146bc8448b371cf1351c05
parent933aeaf09f92c177ee5f172724f8c1955467ef0e (diff)
downloadchromium_src-8ba4546fd0922508e212348f19dd2b624290c683.zip
chromium_src-8ba4546fd0922508e212348f19dd2b624290c683.tar.gz
chromium_src-8ba4546fd0922508e212348f19dd2b624290c683.tar.bz2
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}
-rw-r--r--chrome/browser/chromeos/login/session/user_session_manager.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
index a760b37..bd6bfa9 100644
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -796,6 +796,7 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) {
delegate_->OnProfilePrepared(profile);
UpdateEasyUnlockKeys(profile);
+ user_context_.ClearSecrets();
}
void UserSessionManager::InitSessionRestoreStrategy() {
@@ -1003,6 +1004,13 @@ void UserSessionManager::UpdateEasyUnlockKeys(Profile* user_profile) {
if (user_context_.GetUserType() != user_manager::USER_TYPE_REGULAR)
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.
DCHECK_EQ(SigninManagerFactory::GetForProfile(user_profile)
->GetAuthenticatedAccountId(),