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

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

Issue 6151001: [Chrome OS] Canonicalize username before checking against whitelist (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/signed_settings.cc
diff --git a/chrome/browser/chromeos/login/signed_settings.cc b/chrome/browser/chromeos/login/signed_settings.cc
index 8e400e4ae910ff466f12232a62fe18cff548ce38..2fd03150712b66d6088f5a9af6fa64e707717b66 100644
--- a/chrome/browser/chromeos/login/signed_settings.cc
+++ b/chrome/browser/chromeos/login/signed_settings.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/login_library.h"
+#include "chrome/browser/chromeos/login/authenticator.h"
#include "chrome/browser/chromeos/login/ownership_service.h"
#include "chrome/browser/chromeos/login/signed_settings_temp_storage.h"
@@ -108,7 +109,7 @@ SignedSettings* SignedSettings::CreateCheckWhitelistOp(
const std::string& email,
SignedSettings::Delegate<bool>* d) {
DCHECK(d != NULL);
- return new CheckWhitelistOp(email, d);
+ return new CheckWhitelistOp(Authenticator::Canonicalize(email), d);
}
// static
@@ -117,7 +118,9 @@ SignedSettings* SignedSettings::CreateWhitelistOp(
bool add_to_whitelist,
SignedSettings::Delegate<bool>* d) {
DCHECK(d != NULL);
- return new WhitelistOp(email, add_to_whitelist, d);
+ return new WhitelistOp(Authenticator::Canonicalize(email),
+ add_to_whitelist,
+ d);
}
// static
@@ -148,6 +151,7 @@ CheckWhitelistOp::~CheckWhitelistOp() {}
void CheckWhitelistOp::Execute() {
CHECK(chromeos::CrosLibrary::Get()->EnsureLoaded());
std::vector<uint8> sig;
+ LOG(WARNING) << "HEY! " << email_;
xiyuan 2011/01/06 23:28:27 nit: remove this debug LOG?
if (!CrosLibrary::Get()->GetLoginLibrary()->CheckWhitelist(email_, &sig)) {
d_->OnSettingsOpCompleted(NOT_FOUND, false);
return;
@@ -169,8 +173,10 @@ void CheckWhitelistOp::OnKeyOpComplete(
return;
}
if (return_code == OwnerManager::SUCCESS) {
+ VLOG(2) << "Whitelist check was successful.";
d_->OnSettingsOpCompleted(SUCCESS, true);
} else {
+ VLOG(2) << "Whitelist check failed.";
d_->OnSettingsOpCompleted(SignedSettings::MapKeyOpCode(return_code), false);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698