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

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 9d0a5d22ce2a7199e42aabd790a485e13eb2b81e..3de2654493ec4559163421366b6d872b3b853614 100644
--- a/chrome/browser/chromeos/login/parallel_authenticator.cc
+++ b/chrome/browser/chromeos/login/parallel_authenticator.cc
@@ -23,6 +23,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"
@@ -518,17 +519,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