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

Unified Diff: chromeos/cryptohome/homedir_methods.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
« no previous file with comments | « chromeos/cryptohome/cryptohome_parameters.cc ('k') | chromeos/cryptohome/homedir_methods_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/cryptohome/homedir_methods.cc
diff --git a/chromeos/cryptohome/homedir_methods.cc b/chromeos/cryptohome/homedir_methods.cc
index 8413c72f239dbdc35a33339c00e342cbd733b279..81bf15349dc9dcbf8269be9aba8cd971b053b34f 100644
--- a/chromeos/cryptohome/homedir_methods.cc
+++ b/chromeos/cryptohome/homedir_methods.cc
@@ -95,12 +95,6 @@ void FillKeyProtobuf(const KeyDefinition& key_def, Key* key) {
}
}
-// Fill identification protobuffer.
-void FillIdentificationProtobuf(const Identification& id,
- cryptohome::AccountIdentifier* id_proto) {
- id_proto->set_email(id.user_id);
-}
-
// Fill authorization protobuffer.
void FillAuthorizationProtobuf(const Authorization& auth,
cryptohome::AuthorizationRequest* auth_proto) {
@@ -183,50 +177,38 @@ class HomedirMethodsImpl : public HomedirMethods {
void GetKeyDataEx(const Identification& id,
const std::string& label,
const GetKeyDataCallback& callback) override {
- cryptohome::AccountIdentifier id_proto;
cryptohome::AuthorizationRequest kEmptyAuthProto;
cryptohome::GetKeyDataRequest request;
- FillIdentificationProtobuf(id, &id_proto);
request.mutable_key()->mutable_data()->set_label(label);
DBusThreadManager::Get()->GetCryptohomeClient()->GetKeyDataEx(
- id_proto,
- kEmptyAuthProto,
- request,
+ id, kEmptyAuthProto, request,
base::Bind(&HomedirMethodsImpl::OnGetKeyDataExCallback,
- weak_ptr_factory_.GetWeakPtr(),
- callback));
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void CheckKeyEx(const Identification& id,
const Authorization& auth,
const Callback& callback) override {
- cryptohome::AccountIdentifier id_proto;
cryptohome::AuthorizationRequest auth_proto;
cryptohome::CheckKeyRequest request;
- FillIdentificationProtobuf(id, &id_proto);
FillAuthorizationProtobuf(auth, &auth_proto);
DBusThreadManager::Get()->GetCryptohomeClient()->CheckKeyEx(
- id_proto,
- auth_proto,
- request,
+ id, auth_proto, request,
base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback,
- weak_ptr_factory_.GetWeakPtr(),
- callback));
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void MountEx(const Identification& id,
const Authorization& auth,
const MountParameters& request,
const MountCallback& callback) override {
- cryptohome::AccountIdentifier id_proto;
cryptohome::AuthorizationRequest auth_proto;
cryptohome::MountRequest request_proto;
- FillIdentificationProtobuf(id, &id_proto);
FillAuthorizationProtobuf(auth, &auth_proto);
if (request.ephemeral)
@@ -239,12 +221,9 @@ class HomedirMethodsImpl : public HomedirMethods {
}
DBusThreadManager::Get()->GetCryptohomeClient()->MountEx(
- id_proto,
- auth_proto,
- request_proto,
+ id, auth_proto, request_proto,
base::Bind(&HomedirMethodsImpl::OnMountExCallback,
- weak_ptr_factory_.GetWeakPtr(),
- callback));
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void AddKeyEx(const Identification& id,
@@ -252,43 +231,33 @@ class HomedirMethodsImpl : public HomedirMethods {
const KeyDefinition& new_key,
bool clobber_if_exists,
const Callback& callback) override {
- cryptohome::AccountIdentifier id_proto;
cryptohome::AuthorizationRequest auth_proto;
cryptohome::AddKeyRequest request;
- FillIdentificationProtobuf(id, &id_proto);
FillAuthorizationProtobuf(auth, &auth_proto);
FillKeyProtobuf(new_key, request.mutable_key());
request.set_clobber_if_exists(clobber_if_exists);
DBusThreadManager::Get()->GetCryptohomeClient()->AddKeyEx(
- id_proto,
- auth_proto,
- request,
+ id, auth_proto, request,
base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback,
- weak_ptr_factory_.GetWeakPtr(),
- callback));
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void RemoveKeyEx(const Identification& id,
const Authorization& auth,
const std::string& label,
const Callback& callback) override {
- cryptohome::AccountIdentifier id_proto;
cryptohome::AuthorizationRequest auth_proto;
cryptohome::RemoveKeyRequest request;
- FillIdentificationProtobuf(id, &id_proto);
FillAuthorizationProtobuf(auth, &auth_proto);
request.mutable_key()->mutable_data()->set_label(label);
DBusThreadManager::Get()->GetCryptohomeClient()->RemoveKeyEx(
- id_proto,
- auth_proto,
- request,
+ id, auth_proto, request,
base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback,
- weak_ptr_factory_.GetWeakPtr(),
- callback));
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void UpdateKeyEx(const Identification& id,
@@ -296,22 +265,17 @@ class HomedirMethodsImpl : public HomedirMethods {
const KeyDefinition& new_key,
const std::string& signature,
const Callback& callback) override {
- cryptohome::AccountIdentifier id_proto;
cryptohome::AuthorizationRequest auth_proto;
cryptohome::UpdateKeyRequest pb_update_key;
- FillIdentificationProtobuf(id, &id_proto);
FillAuthorizationProtobuf(auth, &auth_proto);
FillKeyProtobuf(new_key, pb_update_key.mutable_changes());
pb_update_key.set_authorization_signature(signature);
DBusThreadManager::Get()->GetCryptohomeClient()->UpdateKeyEx(
- id_proto,
- auth_proto,
- pb_update_key,
+ id, auth_proto, pb_update_key,
base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback,
- weak_ptr_factory_.GetWeakPtr(),
- callback));
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
private:
« no previous file with comments | « chromeos/cryptohome/cryptohome_parameters.cc ('k') | chromeos/cryptohome/homedir_methods_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698