diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-25 05:16:24 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-25 05:16:24 +0000 |
commit | 49835bb9e7819568a37a07e27f3cee7e1778ec34 (patch) | |
tree | ad26442c6ed04c52bc1b60a2dd77f38328c82f27 /chromeos | |
parent | cc5c016313731d29edbb5d55014b899d73d6a3ff (diff) | |
download | chromium_src-49835bb9e7819568a37a07e27f3cee7e1778ec34.zip chromium_src-49835bb9e7819568a37a07e27f3cee7e1778ec34.tar.gz chromium_src-49835bb9e7819568a37a07e27f3cee7e1778ec34.tar.bz2 |
settings: Add async system salt retrieval logic in DeviceOAuth2TokenServiceFactory
Along the way, remove GetCachedSystemSalt() from SystemSaltGetter.
BUG=309959, 306547
TEST=none
R=hashimoto@chromium.org, pastarmovj@chromium.org
Review URL: https://codereview.chromium.org/39443002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230957 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r-- | chromeos/cryptohome/system_salt_getter.cc | 4 | ||||
-rw-r--r-- | chromeos/cryptohome/system_salt_getter.h | 5 | ||||
-rw-r--r-- | chromeos/dbus/fake_cryptohome_client.cc | 3 | ||||
-rw-r--r-- | chromeos/dbus/fake_cryptohome_client.h | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/chromeos/cryptohome/system_salt_getter.cc b/chromeos/cryptohome/system_salt_getter.cc index f299f0f..1fa25a3 100644 --- a/chromeos/cryptohome/system_salt_getter.cc +++ b/chromeos/cryptohome/system_salt_getter.cc @@ -38,10 +38,6 @@ std::string SystemSaltGetter::GetSystemSaltSync() { return system_salt_; } -std::string SystemSaltGetter::GetCachedSystemSalt() { - return system_salt_; -} - void SystemSaltGetter::GetSystemSaltInternal( const GetSystemSaltCallback& callback, bool service_is_available) { diff --git a/chromeos/cryptohome/system_salt_getter.h b/chromeos/cryptohome/system_salt_getter.h index a47b617..1e4cf81 100644 --- a/chromeos/cryptohome/system_salt_getter.h +++ b/chromeos/cryptohome/system_salt_getter.h @@ -40,11 +40,6 @@ class CHROMEOS_EXPORT SystemSaltGetter { // DEPRECATED: DO NOT USE. std::string GetSystemSaltSync(); - // Returns system hash in hex encoded ascii format, cached by a prior call - // to GetSystemSalt(). Note: this may return an empty string (e.g. if - // GetSystemSalt() is not yet called). - std::string GetCachedSystemSalt(); - protected: SystemSaltGetter(); ~SystemSaltGetter(); diff --git a/chromeos/dbus/fake_cryptohome_client.cc b/chromeos/dbus/fake_cryptohome_client.cc index d23be71..861a1c5 100644 --- a/chromeos/dbus/fake_cryptohome_client.cc +++ b/chromeos/dbus/fake_cryptohome_client.cc @@ -17,6 +17,7 @@ FakeCryptohomeClient::FakeCryptohomeClient() async_call_id_(1), tpm_is_ready_counter_(0), unmount_result_(true), + system_salt_(GetStubSystemSalt()), locked_(false), weak_ptr_factory_(this) {} @@ -80,7 +81,7 @@ void FakeCryptohomeClient::AsyncRemove( } bool FakeCryptohomeClient::GetSystemSalt(std::vector<uint8>* salt) { - *salt = GetStubSystemSalt(); + *salt = system_salt_; return true; } diff --git a/chromeos/dbus/fake_cryptohome_client.h b/chromeos/dbus/fake_cryptohome_client.h index 3c960e8..450678b 100644 --- a/chromeos/dbus/fake_cryptohome_client.h +++ b/chromeos/dbus/fake_cryptohome_client.h @@ -162,6 +162,13 @@ class CHROMEOS_EXPORT FakeCryptohomeClient : public CryptohomeClient { unmount_result_= result; } + // Sets the system salt which will be returned from GetSystemSalt(). By + // default, GetSystemSalt() returns the value generated by + // GetStubSystemSalt(). + void set_system_salt(const std::vector<uint8>& system_salt) { + system_salt_ = system_salt; + } + // Returns the stub system salt as raw bytes. (not as a string encoded in the // format used by SystemSaltGetter::ConvertRawSaltToHexString()). static std::vector<uint8> GetStubSystemSalt(); @@ -181,6 +188,7 @@ class CHROMEOS_EXPORT FakeCryptohomeClient : public CryptohomeClient { AsyncCallStatusWithDataHandler async_call_status_data_handler_; int tpm_is_ready_counter_; bool unmount_result_; + std::vector<uint8> system_salt_; std::vector<WaitForServiceToBeAvailableCallback> pending_wait_for_service_to_be_available_callbacks_; |