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

Side by Side Diff: chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc

Issue 554043003: cros: Create cryptohome keys for Easy sign-in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for comments in #2 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 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/auth/chrome_cryptohome_authenticator.h" 5 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 scoped_ptr<std::string> salt) { 259 scoped_ptr<std::string> salt) {
260 key_data_.clear(); 260 key_data_.clear();
261 key_data_.push_back(new cryptohome::RetrievedKeyData( 261 key_data_.push_back(new cryptohome::RetrievedKeyData(
262 cryptohome::RetrievedKeyData::TYPE_PASSWORD, 262 cryptohome::RetrievedKeyData::TYPE_PASSWORD,
263 kCryptohomeGAIAKeyLabel, 263 kCryptohomeGAIAKeyLabel,
264 1)); 264 1));
265 key_data_.front()->privileges = cryptohome::PRIV_DEFAULT; 265 key_data_.front()->privileges = cryptohome::PRIV_DEFAULT;
266 key_data_.front()->authorization_types.push_back( 266 key_data_.front()->authorization_types.push_back(
267 cryptohome::RetrievedKeyData::AUTHORIZATION_TYPE_HMACSHA256); 267 cryptohome::RetrievedKeyData::AUTHORIZATION_TYPE_HMACSHA256);
268 if (key_type) { 268 if (key_type) {
269 scoped_ptr<cryptohome::RetrievedKeyData::ProviderData> provider_data( 269 key_data_.front()->provider_data.push_back(
270 new cryptohome::RetrievedKeyData::ProviderData("type")); 270 cryptohome::ProviderDataEntry("type", *key_type));
271 provider_data->number = key_type.Pass();
272 key_data_.front()->provider_data.push_back(provider_data.release());
273 } 271 }
274 if (salt) { 272 if (salt) {
275 scoped_ptr<cryptohome::RetrievedKeyData::ProviderData> provider_data( 273 key_data_.front()->provider_data.push_back(
276 new cryptohome::RetrievedKeyData::ProviderData("salt")); 274 cryptohome::ProviderDataEntry("salt", *salt));
277 provider_data->bytes = salt.Pass();
278 key_data_.front()->provider_data.push_back(provider_data.release());
279 } 275 }
280 EXPECT_CALL(*mock_homedir_methods_, GetKeyDataEx( 276 EXPECT_CALL(*mock_homedir_methods_, GetKeyDataEx(
281 cryptohome::Identification(user_context_.GetUserID()), 277 cryptohome::Identification(user_context_.GetUserID()),
282 kCryptohomeGAIAKeyLabel, 278 kCryptohomeGAIAKeyLabel,
283 _)) 279 _))
284 .WillOnce(WithArg<2>(Invoke( 280 .WillOnce(WithArg<2>(Invoke(
285 this, 281 this,
286 &CryptohomeAuthenticatorTest::InvokeGetDataExCallback))); 282 &CryptohomeAuthenticatorTest::InvokeGetDataExCallback)));
287 } 283 }
288 284
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 // salt. 826 // salt.
831 ExpectGetKeyDataExCall( 827 ExpectGetKeyDataExCall(
832 make_scoped_ptr(new int64(Key::KEY_TYPE_SALTED_SHA256)), 828 make_scoped_ptr(new int64(Key::KEY_TYPE_SALTED_SHA256)),
833 scoped_ptr<std::string>()); 829 scoped_ptr<std::string>());
834 830
835 auth_->AuthenticateToLogin(NULL, user_context_); 831 auth_->AuthenticateToLogin(NULL, user_context_);
836 base::RunLoop().Run(); 832 base::RunLoop().Run();
837 } 833 }
838 834
839 } // namespace chromeos 835 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698