summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/cryptohome/system_salt_getter.cc4
-rw-r--r--chromeos/cryptohome/system_salt_getter.h5
-rw-r--r--chromeos/dbus/fake_cryptohome_client.cc3
-rw-r--r--chromeos/dbus/fake_cryptohome_client.h8
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_;