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

Unified Diff: chrome/browser/chromeos/login/parallel_authenticator.cc

Issue 23684033: Fix device policy recovery on CrOS login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/parallel_authenticator.cc
diff --git a/chrome/browser/chromeos/login/parallel_authenticator.cc b/chrome/browser/chromeos/login/parallel_authenticator.cc
index 1f85f8d42f02404d8dcf07fd2a13e66d56b8c1b7..54b5aaf7e8e5cbffd9f6d14ea0bfe758958f2015 100644
--- a/chrome/browser/chromeos/login/parallel_authenticator.cc
+++ b/chrome/browser/chromeos/login/parallel_authenticator.cc
@@ -22,6 +22,7 @@
#include "chromeos/cryptohome/cryptohome_library.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/login/login_state.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "crypto/sha2.h"
@@ -517,17 +518,20 @@ bool ParallelAuthenticator::VerifyOwner() {
// Now we can continue reading the private key.
DeviceSettingsService::Get()->SetUsername(
current_state_->user_context.username);
- DeviceSettingsService::Get()->GetOwnershipStatusAsync(
+ // This should trigger certificate loading, which is needed in order to
+ // correctly determine if the current user is the owner.
+ if (LoginState::IsInitialized()) {
+ LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE,
+ LoginState::LOGGED_IN_USER_NONE);
+ }
+ DeviceSettingsService::Get()->IsCurrentUserOwnerAsync(
base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this));
return false;
}
-void ParallelAuthenticator::OnOwnershipChecked(
- DeviceSettingsService::OwnershipStatus status) {
+void ParallelAuthenticator::OnOwnershipChecked(bool is_owner) {
// Now we can check if this user is the owner.
- // TODO(tbarzic): This is broken. At this point, DeviceSettingsService will
- // never have private key loaded (http://crbug.com/285450).
- user_can_login_ = DeviceSettingsService::Get()->HasPrivateOwnerKey();
+ user_can_login_ = is_owner;
owner_is_verified_ = true;
Resolve();
}

Powered by Google App Engine
This is Rietveld 408576698