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

Unified Diff: chromeos/cryptohome/system_salt_getter.cc

Issue 1886653002: Remove WallpaperManager dependency on Cryptohome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase (raw_salt_ is now properly set). Created 4 years, 8 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/system_salt_getter.h ('k') | components/wallpaper/wallpaper_manager_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/cryptohome/system_salt_getter.cc
diff --git a/chromeos/cryptohome/system_salt_getter.cc b/chromeos/cryptohome/system_salt_getter.cc
index 0e79fc1298e1be01d350e7951b3e36667901d4cf..cba4050bf08b450c9e451a79767486fd33c87879 100644
--- a/chromeos/cryptohome/system_salt_getter.cc
+++ b/chromeos/cryptohome/system_salt_getter.cc
@@ -42,6 +42,15 @@ void SystemSaltGetter::GetSystemSalt(
callback));
}
+const SystemSaltGetter::RawSalt* SystemSaltGetter::GetRawSalt() const {
+ return raw_salt_.empty() ? nullptr : &raw_salt_;
+}
+
+void SystemSaltGetter::SetRawSaltForTesting(
+ const SystemSaltGetter::RawSalt& raw_salt) {
+ raw_salt_ = raw_salt;
+}
+
void SystemSaltGetter::DidWaitForServiceToBeAvailable(
const GetSystemSaltCallback& callback,
bool service_is_available) {
@@ -62,10 +71,12 @@ void SystemSaltGetter::DidGetSystemSalt(
const std::vector<uint8_t>& system_salt) {
if (call_status == DBUS_METHOD_CALL_SUCCESS &&
!system_salt.empty() &&
- system_salt.size() % 2 == 0U)
+ system_salt.size() % 2 == 0U) {
+ raw_salt_ = system_salt;
system_salt_ = ConvertRawSaltToHexString(system_salt);
- else
+ } else {
LOG(WARNING) << "System salt not available";
+ }
callback.Run(system_salt_);
}
« no previous file with comments | « chromeos/cryptohome/system_salt_getter.h ('k') | components/wallpaper/wallpaper_manager_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698