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/managed/managed_user_creation_controller
_new.h" | 5 #include "chrome/browser/chromeos/login/managed/managed_user_creation_controller
_new.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // It can be used for mounting homedir, and can be replaced only when signed. | 265 // It can be used for mounting homedir, and can be replaced only when signed. |
266 cryptohome::KeyDefinition password_key(creation_context_->salted_password, | 266 cryptohome::KeyDefinition password_key(creation_context_->salted_password, |
267 kCryptohomeManagedUserKeyLabel, | 267 kCryptohomeManagedUserKeyLabel, |
268 kCryptohomeManagedUserKeyPrivileges); | 268 kCryptohomeManagedUserKeyPrivileges); |
269 base::Base64Decode(creation_context_->encryption_key, | 269 base::Base64Decode(creation_context_->encryption_key, |
270 &password_key.encryption_key); | 270 &password_key.encryption_key); |
271 base::Base64Decode(creation_context_->signature_key, | 271 base::Base64Decode(creation_context_->signature_key, |
272 &password_key.signature_key); | 272 &password_key.signature_key); |
273 | 273 |
274 Key key(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, | 274 Key key(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, |
275 creation_context_->salted_master_key, | 275 std::string(), // The salt is stored elsewhere. |
276 std::string()); // The salt is stored elsewhere. | 276 creation_context_->salted_master_key); |
277 key.SetLabel(kCryptohomeMasterKeyLabel); | 277 key.SetLabel(kCryptohomeMasterKeyLabel); |
278 UserContext context(creation_context_->local_user_id); | 278 UserContext context(creation_context_->local_user_id); |
279 context.SetKey(key); | 279 context.SetKey(key); |
280 context.SetIsUsingOAuth(false); | 280 context.SetIsUsingOAuth(false); |
281 | 281 |
282 authenticator_->AddKey( | 282 authenticator_->AddKey( |
283 context, | 283 context, |
284 password_key, | 284 password_key, |
285 true, | 285 true, |
286 base::Bind(&ManagedUserCreationControllerNew::OnAddKeySuccess, | 286 base::Bind(&ManagedUserCreationControllerNew::OnAddKeySuccess, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 creation_context_->registration_utility.reset(); | 392 creation_context_->registration_utility.reset(); |
393 chrome::AttemptUserExit(); | 393 chrome::AttemptUserExit(); |
394 } | 394 } |
395 | 395 |
396 std::string ManagedUserCreationControllerNew::GetManagedUserId() { | 396 std::string ManagedUserCreationControllerNew::GetManagedUserId() { |
397 DCHECK(creation_context_); | 397 DCHECK(creation_context_); |
398 return creation_context_->local_user_id; | 398 return creation_context_->local_user_id; |
399 } | 399 } |
400 | 400 |
401 } // namespace chromeos | 401 } // namespace chromeos |
OLD | NEW |