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

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

Issue 526353002: Merge cryptohome::RetrievedKeyData with cryptohome::KeyDefinition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d_2_367847_add_get_key_data_ex_to_mount_flow
Patch Set: Rebased. Created 6 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
« no previous file with comments | « chromeos/cryptohome/mock_homedir_methods.cc ('k') | chromeos/login/auth/extended_authenticator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/login/auth/cryptohome_authenticator.cc
diff --git a/chromeos/login/auth/cryptohome_authenticator.cc b/chromeos/login/auth/cryptohome_authenticator.cc
index d00cf29f1aa14af10c3b2326b4ba179dd755a084..0c3c162f3ed5416b6028303f1e345054f3dac3cc 100644
--- a/chromeos/login/auth/cryptohome_authenticator.cc
+++ b/chromeos/login/auth/cryptohome_authenticator.cc
@@ -4,6 +4,8 @@
#include "chromeos/login/auth/cryptohome_authenticator.h"
+#include <vector>
+
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/files/file_path.h"
@@ -175,32 +177,33 @@ void OnGetSystemSalt(AuthAttemptState* attempt,
// |attempt->user_context| can be transformed with Chrome's default hashing
// algorithm and the system salt.
// The resulting key is then passed to cryptohome's MountEx().
-void OnGetKeyDataEx(AuthAttemptState* attempt,
- scoped_refptr<CryptohomeAuthenticator> resolver,
- bool ephemeral,
- bool create_if_nonexistent,
- bool success,
- cryptohome::MountError return_code,
- ScopedVector<cryptohome::RetrievedKeyData> key_data) {
+void OnGetKeyDataEx(
+ AuthAttemptState* attempt,
+ scoped_refptr<CryptohomeAuthenticator> resolver,
+ bool ephemeral,
+ bool create_if_nonexistent,
+ bool success,
+ cryptohome::MountError return_code,
+ const std::vector<cryptohome::KeyDefinition>& key_definitions) {
if (success) {
- if (key_data.size() == 1) {
- cryptohome::RetrievedKeyData* key_data_entry = key_data.front();
- DCHECK_EQ(kCryptohomeGAIAKeyLabel, key_data_entry->label);
+ if (key_definitions.size() == 1) {
+ const cryptohome::KeyDefinition& key_definition = key_definitions.front();
+ DCHECK_EQ(kCryptohomeGAIAKeyLabel, key_definition.label);
- // Extract the key type and salt from |key_data|, if present.
+ // Extract the key type and salt from |key_definition|, if present.
scoped_ptr<int64> type;
scoped_ptr<std::string> salt;
- for (ScopedVector<cryptohome::RetrievedKeyData::ProviderData>::
- const_iterator it = key_data_entry->provider_data.begin();
- it != key_data_entry->provider_data.end(); ++it) {
- if ((*it)->name == kKeyProviderDataTypeName) {
- if ((*it)->number)
- type.reset(new int64(*(*it)->number));
+ for (std::vector<cryptohome::KeyDefinition::ProviderData>::
+ const_iterator it = key_definition.provider_data.begin();
+ it != key_definition.provider_data.end(); ++it) {
+ if (it->name == kKeyProviderDataTypeName) {
+ if (it->number)
+ type.reset(new int64(*it->number));
else
NOTREACHED();
- } else if ((*it)->name == kKeyProviderDataSaltName) {
- if ((*it)->bytes)
- salt.reset(new std::string(*(*it)->bytes));
+ } else if (it->name == kKeyProviderDataSaltName) {
+ if (it->bytes)
+ salt.reset(new std::string(*it->bytes));
else
NOTREACHED();
}
@@ -226,7 +229,7 @@ void OnGetKeyDataEx(AuthAttemptState* attempt,
return;
}
} else {
- LOG(ERROR) << "GetKeyDataEx() returned " << key_data.size()
+ LOG(ERROR) << "GetKeyDataEx() returned " << key_definitions.size()
<< " entries.";
}
}
« no previous file with comments | « chromeos/cryptohome/mock_homedir_methods.cc ('k') | chromeos/login/auth/extended_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698