| Index: chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc
|
| diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc
|
| index 6da94f90495f0e01997ee874cbcfcd07980f925d..1fa75b640a374f923bc4045f4135399e4c0a577d 100644
|
| --- a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc
|
| +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc
|
| @@ -14,6 +14,7 @@
|
| #include "base/threading/sequenced_worker_pool.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/chromeos/login/managed/locally_managed_user_constants.h"
|
| +#include "chrome/browser/chromeos/login/managed/supervised_user_authentication.h"
|
| #include "chrome/browser/chromeos/login/mount_manager.h"
|
| #include "chrome/browser/chromeos/login/supervised_user_manager.h"
|
| #include "chrome/browser/chromeos/login/user.h"
|
| @@ -149,10 +150,19 @@ void LocallyManagedUserCreationController::StartCreation() {
|
| creation_context_->display_name);
|
|
|
| manager->SetCreationTransactionUserId(creation_context_->local_user_id);
|
| + SupervisedUserAuthentication* authentication = manager->GetAuthentication();
|
| + if (authentication->FillDataForNewUser(creation_context_->local_user_id,
|
| + creation_context_->password,
|
| + &creation_context_->password_data)) {
|
| + authentication->StorePasswordData(creation_context_->local_user_id,
|
| + creation_context_->password_data);
|
| + }
|
| VLOG(1) << "Creating cryptohome";
|
| authenticator_ = new ManagedUserAuthenticator(this);
|
| authenticator_->AuthenticateToCreate(creation_context_->local_user_id,
|
| - creation_context_->password);
|
| + authentication->TransformPassword(
|
| + creation_context_->local_user_id,
|
| + creation_context_->password));
|
| }
|
|
|
| void LocallyManagedUserCreationController::OnAuthenticationFailure(
|
| @@ -190,8 +200,13 @@ void LocallyManagedUserCreationController::OnMountSuccess(
|
| }
|
|
|
| VLOG(1) << "Adding master key";
|
| + SupervisedUserAuthentication* authentication = UserManager::Get()->
|
| + GetSupervisedUserManager()->GetAuthentication();
|
| +
|
| authenticator_->AddMasterKey(creation_context_->local_user_id,
|
| - creation_context_->password,
|
| + authentication->TransformPassword(
|
| + creation_context_->local_user_id,
|
| + creation_context_->password),
|
| creation_context_->master_key);
|
| }
|
|
|
| @@ -201,6 +216,8 @@ void LocallyManagedUserCreationController::OnAddKeySuccess() {
|
| creation_context_->manager_profile);
|
|
|
| VLOG(1) << "Creating user on server";
|
| + // TODO(antrim) : add password data to sync once API is ready.
|
| + // http://crbug.com/316168
|
| ManagedUserRegistrationInfo info(creation_context_->display_name,
|
| creation_context_->avatar_index);
|
| info.master_key = creation_context_->master_key;
|
|
|