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

Side by Side Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Fix Win GN build. Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_oper ation.h" 5 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_oper ation.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( 339 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData(
340 kEasyUnlockKeyMetaNamePsk, device->psk)); 340 kEasyUnlockKeyMetaNamePsk, device->psk));
341 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( 341 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData(
342 kEasyUnlockKeyMetaNamePubKey, device->public_key)); 342 kEasyUnlockKeyMetaNamePubKey, device->public_key));
343 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( 343 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData(
344 kEasyUnlockKeyMetaNameChallenge, device->challenge)); 344 kEasyUnlockKeyMetaNameChallenge, device->challenge));
345 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( 345 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData(
346 kEasyUnlockKeyMetaNameWrappedSecret, device->wrapped_secret)); 346 kEasyUnlockKeyMetaNameWrappedSecret, device->wrapped_secret));
347 347
348 // Add cryptohome key. 348 // Add cryptohome key.
349 std::string canonicalized = 349 const std::string canonicalized =
350 gaia::CanonicalizeEmail(user_context_.GetUserID()); 350 gaia::CanonicalizeEmail(user_context_.GetAccountId().GetUserEmail());
351 cryptohome::Identification id(canonicalized); 351 cryptohome::Identification id(canonicalized);
352 352
353 scoped_ptr<Key> auth_key(new Key(*user_context_.GetKey())); 353 scoped_ptr<Key> auth_key(new Key(*user_context_.GetKey()));
354 if (auth_key->GetKeyType() == Key::KEY_TYPE_PASSWORD_PLAIN) 354 if (auth_key->GetKeyType() == Key::KEY_TYPE_PASSWORD_PLAIN)
355 auth_key->Transform(Key::KEY_TYPE_SALTED_SHA256_TOP_HALF, system_salt); 355 auth_key->Transform(Key::KEY_TYPE_SALTED_SHA256_TOP_HALF, system_salt);
356 356
357 cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel()); 357 cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel());
358 cryptohome::HomedirMethods::GetInstance()->AddKeyEx( 358 cryptohome::HomedirMethods::GetInstance()->AddKeyEx(
359 id, 359 id,
360 auth, 360 auth,
(...skipping 24 matching lines...) Expand all
385 user_context_.GetKey()->GetLabel() == 385 user_context_.GetKey()->GetLabel() ==
386 EasyUnlockKeyManager::GetKeyLabel(key_creation_index_)) { 386 EasyUnlockKeyManager::GetKeyLabel(key_creation_index_)) {
387 user_context_.SetKey(user_key); 387 user_context_.SetKey(user_key);
388 } 388 }
389 389
390 ++key_creation_index_; 390 ++key_creation_index_;
391 CreateKeyForDeviceAtIndex(key_creation_index_); 391 CreateKeyForDeviceAtIndex(key_creation_index_);
392 } 392 }
393 393
394 } // namespace chromeos 394 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698