Stop using (and remove) deprecated SetSystemSaltPath API
There's a deprecated function in libchromeos to set the path of
the file in which the systemwide cryptographic salt value is
stored. Stop using it, and delete it.
BUG=chromium:378836
TEST=build platform2 and chromeos-login, run unit tests.
TEST=paladin trybot
Change-Id: I08ae6129c00921b57b8a5ffc7d59998b2c18f47c
Reviewed-on: https://chromium-review.googlesource.com/202508
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>
diff --git a/libchromeos/chromeos/cryptohome.cc b/libchromeos/chromeos/cryptohome.cc
index 69cf734..239c5c1 100644
--- a/libchromeos/chromeos/cryptohome.cc
+++ b/libchromeos/chromeos/cryptohome.cc
@@ -122,14 +122,6 @@
strcpy(g_root_home_prefix, prefix.c_str());
}
-void SetSystemSaltPath(const std::string& path) {
- if (path.length() < sizeof(g_system_salt_path)) {
- strcpy(g_system_salt_path, path.c_str());
- delete salt;
- salt = NULL;
- }
-}
-
std::string* GetSystemSalt() {
return salt;
}
diff --git a/libchromeos/chromeos/cryptohome.h b/libchromeos/chromeos/cryptohome.h
index 4675635..182c5e4 100644
--- a/libchromeos/chromeos/cryptohome.h
+++ b/libchromeos/chromeos/cryptohome.h
@@ -55,10 +55,6 @@
// created. This is used for testing only.
void SetRootHomePrefix(const std::string& prefix);
-// Overrides the path of the system salt. This is used for testing only.
-// DEPRECATED: If you are using this, please move to SetSystemSalt().
-void SetSystemSaltPath(const std::string& path);
-
// Overrides the contents of the system salt.
// salt should be non-NULL and non-empty when attempting to avoid filesystem
// usage in tests.
diff --git a/login_manager/device_local_account_policy_service_unittest.cc b/login_manager/device_local_account_policy_service_unittest.cc
index 87aaa7c..9b88b1d 100644
--- a/login_manager/device_local_account_policy_service_unittest.cc
+++ b/login_manager/device_local_account_policy_service_unittest.cc
@@ -34,15 +34,13 @@
class DeviceLocalAccountPolicyServiceTest : public ::testing::Test {
public:
DeviceLocalAccountPolicyServiceTest()
- : fake_account_("account@example.com") {
+ : fake_account_("account@example.com"),
+ salt_("salt") {
}
virtual void SetUp() OVERRIDE {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
-
- base::FilePath salt_path = temp_dir_.path().Append("salt");
- ASSERT_EQ(0, base::WriteFile(salt_path, NULL, 0));
- chromeos::cryptohome::home::SetSystemSaltPath(salt_path.value());
+ chromeos::cryptohome::home::SetSystemSalt(&salt_);
fake_account_policy_path_ =
temp_dir_.path()
@@ -84,6 +82,7 @@
const std::string fake_account_;
base::FilePath fake_account_policy_path_;
+ std::string salt_;
std::string policy_blob_;
base::MessageLoop loop_;