OLD | NEW |
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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 kEasyUnlockKeyMetaNameBluetoothType, | 346 kEasyUnlockKeyMetaNameBluetoothType, |
347 static_cast<int64_t>(device->bluetooth_type))); | 347 static_cast<int64_t>(device->bluetooth_type))); |
348 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( | 348 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( |
349 kEasyUnlockKeyMetaNamePsk, device->psk)); | 349 kEasyUnlockKeyMetaNamePsk, device->psk)); |
350 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( | 350 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( |
351 kEasyUnlockKeyMetaNamePubKey, device->public_key)); | 351 kEasyUnlockKeyMetaNamePubKey, device->public_key)); |
352 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( | 352 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( |
353 kEasyUnlockKeyMetaNameChallenge, device->challenge)); | 353 kEasyUnlockKeyMetaNameChallenge, device->challenge)); |
354 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( | 354 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( |
355 kEasyUnlockKeyMetaNameWrappedSecret, device->wrapped_secret)); | 355 kEasyUnlockKeyMetaNameWrappedSecret, device->wrapped_secret)); |
| 356 key_def.provider_data.push_back(cryptohome::KeyDefinition::ProviderData( |
| 357 kEasyUnlockKeyMetaNameSerializedBeaconSeeds, |
| 358 device->serialized_beacon_seeds)); |
356 | 359 |
357 // Add cryptohome key. | 360 // Add cryptohome key. |
358 const cryptohome::Identification id(user_context_.GetAccountId()); | 361 const cryptohome::Identification id(user_context_.GetAccountId()); |
359 | 362 |
360 std::unique_ptr<Key> auth_key(new Key(*user_context_.GetKey())); | 363 std::unique_ptr<Key> auth_key(new Key(*user_context_.GetKey())); |
361 if (auth_key->GetKeyType() == Key::KEY_TYPE_PASSWORD_PLAIN) | 364 if (auth_key->GetKeyType() == Key::KEY_TYPE_PASSWORD_PLAIN) |
362 auth_key->Transform(Key::KEY_TYPE_SALTED_SHA256_TOP_HALF, system_salt); | 365 auth_key->Transform(Key::KEY_TYPE_SALTED_SHA256_TOP_HALF, system_salt); |
363 | 366 |
364 cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel()); | 367 cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel()); |
365 cryptohome::HomedirMethods::GetInstance()->AddKeyEx( | 368 cryptohome::HomedirMethods::GetInstance()->AddKeyEx( |
(...skipping 26 matching lines...) Expand all Loading... |
392 user_context_.GetKey()->GetLabel() == | 395 user_context_.GetKey()->GetLabel() == |
393 EasyUnlockKeyManager::GetKeyLabel(key_creation_index_)) { | 396 EasyUnlockKeyManager::GetKeyLabel(key_creation_index_)) { |
394 user_context_.SetKey(user_key); | 397 user_context_.SetKey(user_key); |
395 } | 398 } |
396 | 399 |
397 ++key_creation_index_; | 400 ++key_creation_index_; |
398 CreateKeyForDeviceAtIndex(key_creation_index_); | 401 CreateKeyForDeviceAtIndex(key_creation_index_); |
399 } | 402 } |
400 | 403 |
401 } // namespace chromeos | 404 } // namespace chromeos |
OLD | NEW |