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

Unified Diff: chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc

Issue 101283003: Add first implemenation for SU password sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 7 years 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698