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

Unified Diff: chromeos/login/auth/extended_authenticator_impl.cc

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests. Created 4 years, 10 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: chromeos/login/auth/extended_authenticator_impl.cc
diff --git a/chromeos/login/auth/extended_authenticator_impl.cc b/chromeos/login/auth/extended_authenticator_impl.cc
index 25d95207dece5e6fe1fe15b6c12aedf7dc8a64e4..98ec0b90c89108d49c3289ae27e918806caf92f4 100644
--- a/chromeos/login/auth/extended_authenticator_impl.cc
+++ b/chromeos/login/auth/extended_authenticator_impl.cc
@@ -82,19 +82,18 @@ void ExtendedAuthenticatorImpl::AuthenticateToCheck(
}
void ExtendedAuthenticatorImpl::CreateMount(
- const std::string& user_id,
+ const AccountId& account_id,
const std::vector<cryptohome::KeyDefinition>& keys,
const ResultCallback& success_callback) {
RecordStartMarker("MountEx");
- std::string canonicalized = gaia::CanonicalizeEmail(user_id);
- cryptohome::Identification id(canonicalized);
+ cryptohome::Identification id(account_id);
cryptohome::Authorization auth(keys.front());
cryptohome::MountParameters mount(false);
for (size_t i = 0; i < keys.size(); i++) {
mount.create_keys.push_back(keys[i]);
}
- UserContext context(AccountId::FromUserEmail(user_id));
+ UserContext context(account_id);
Key key(keys.front().secret);
key.SetLabel(keys.front().label);
context.SetKey(key);
@@ -189,9 +188,7 @@ void ExtendedAuthenticatorImpl::DoAuthenticateToMount(
const UserContext& user_context) {
RecordStartMarker("MountEx");
- const std::string canonicalized =
- gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
- cryptohome::Identification id(canonicalized);
+ cryptohome::Identification id(user_context.GetAccountId());
const Key* const key = user_context.GetKey();
cryptohome::Authorization auth(key->GetSecret(), key->GetLabel());
cryptohome::MountParameters mount(false);
@@ -212,9 +209,7 @@ void ExtendedAuthenticatorImpl::DoAuthenticateToCheck(
const UserContext& user_context) {
RecordStartMarker("CheckKeyEx");
- const std::string canonicalized =
- gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
- cryptohome::Identification id(canonicalized);
+ cryptohome::Identification id(user_context.GetAccountId());
const Key* const key = user_context.GetKey();
cryptohome::Authorization auth(key->GetSecret(), key->GetLabel());
@@ -234,9 +229,7 @@ void ExtendedAuthenticatorImpl::DoAddKey(const cryptohome::KeyDefinition& key,
const UserContext& user_context) {
RecordStartMarker("AddKeyEx");
- const std::string canonicalized =
- gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
- cryptohome::Identification id(canonicalized);
+ cryptohome::Identification id(user_context.GetAccountId());
const Key* const auth_key = user_context.GetKey();
cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel());
@@ -259,9 +252,7 @@ void ExtendedAuthenticatorImpl::DoUpdateKeyAuthorized(
const UserContext& user_context) {
RecordStartMarker("UpdateKeyAuthorized");
- const std::string canonicalized =
- gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
- cryptohome::Identification id(canonicalized);
+ cryptohome::Identification id(user_context.GetAccountId());
const Key* const auth_key = user_context.GetKey();
cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel());
@@ -282,9 +273,7 @@ void ExtendedAuthenticatorImpl::DoRemoveKey(const std::string& key_to_remove,
const UserContext& user_context) {
RecordStartMarker("RemoveKeyEx");
- const std::string canonicalized =
- gaia::CanonicalizeEmail(user_context.GetAccountId().GetUserEmail());
- cryptohome::Identification id(canonicalized);
+ cryptohome::Identification id(user_context.GetAccountId());
const Key* const auth_key = user_context.GetKey();
cryptohome::Authorization auth(auth_key->GetSecret(), auth_key->GetLabel());
« no previous file with comments | « chromeos/login/auth/extended_authenticator_impl.h ('k') | chromeos/login/auth/fake_extended_authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698