Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc

Issue 585213002: [Easy signin] Wire up userClick auth attempt to easy unlock app and back (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@easy_signin_focused_user_changed_observer
Patch Set: fix screenlock private test Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc
diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc
index 21e7bedb46d149252baba07326a3223a424f1c5a..b98afec3de259cb4a994c67b7419fdb41bee85dc 100644
--- a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc
+++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc
@@ -354,9 +354,8 @@ void EasyUnlockCreateKeysOperation::OnGetSystemSalt(
kEasyUnlockKeyMetaNamePubKey, device->public_key));
key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData(
kEasyUnlockKeyMetaNameChallenge, device->challenge));
- // TODO(xiyuan): Store wrapped secret when all pieces are in place.
key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData(
- kEasyUnlockKeyMetaNameWrappedSecret, challenge_creator_->user_key()));
+ kEasyUnlockKeyMetaNameWrappedSecret, device->wrapped_secret));
// Add cryptohome key.
std::string canonicalized =
@@ -371,11 +370,13 @@ void EasyUnlockCreateKeysOperation::OnGetSystemSalt(
true, // clobber
base::Bind(&EasyUnlockCreateKeysOperation::OnKeyCreated,
weak_ptr_factory_.GetWeakPtr(),
- index));
+ index,
+ user_key));
}
void EasyUnlockCreateKeysOperation::OnKeyCreated(
size_t index,
+ const Key& user_key,
bool success,
cryptohome::MountError return_code) {
DCHECK_EQ(key_creation_index_, index);
@@ -386,6 +387,14 @@ void EasyUnlockCreateKeysOperation::OnKeyCreated(
return;
}
+ // If the key associated with the current context changed (i.e. in the case
+ // the current signin flow was Easy signin), update the user context.
+ if (user_context_.GetAuthFlow() == UserContext::AUTH_FLOW_EASY_UNLOCK &&
+ user_context_.GetKey()->GetLabel() ==
+ EasyUnlockKeyManager::GetKeyLabel(key_creation_index_)) {
+ user_context_.SetKey(user_key);
+ }
+
++key_creation_index_;
CreateKeyForDeviceAtIndex(key_creation_index_);
}

Powered by Google App Engine
This is Rietveld 408576698