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

Unified Diff: chrome/browser/chromeos/settings/token_encryptor.h

Issue 39443002: settings: Add async system salt retrieval logic in DeviceOAuth2TokenServiceFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 years, 2 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
Index: chrome/browser/chromeos/settings/token_encryptor.h
diff --git a/chrome/browser/chromeos/settings/token_encryptor.h b/chrome/browser/chromeos/settings/token_encryptor.h
index 8892dc6b2b6531512f9ef4e38a0b405d308d7715..61d6d47d58f1e144ae66c1346c8aa2e7fada1bee 100644
--- a/chrome/browser/chromeos/settings/token_encryptor.h
+++ b/chrome/browser/chromeos/settings/token_encryptor.h
@@ -33,11 +33,11 @@ class TokenEncryptor {
const std::string& encrypted_token_hex) = 0;
};
-// TokenEncryptor based on the cryptohome daemon. This implementation is used
-// in production.
+// TokenEncryptor based on the system salt from cryptohome daemon. This
+// implementation is used in production.
class CryptohomeTokenEncryptor : public TokenEncryptor {
public:
- CryptohomeTokenEncryptor();
+ explicit CryptohomeTokenEncryptor(const std::string& system_salt);
virtual ~CryptohomeTokenEncryptor();
// TokenEncryptor overrides:
@@ -46,10 +46,6 @@ class CryptohomeTokenEncryptor : public TokenEncryptor {
const std::string& encrypted_token_hex) OVERRIDE;
private:
- // Loads the system salt key based on the system salt from the cryptohome
- // daemon. Returns true on success.
- bool LoadSystemSaltKey();
-
// Converts |passphrase| to a SymmetricKey using the given |salt|.
crypto::SymmetricKey* PassphraseToKey(const std::string& passphrase,
const std::string& salt);
@@ -64,7 +60,8 @@ class CryptohomeTokenEncryptor : public TokenEncryptor {
const std::string& salt,
const std::string& encrypted_token_hex);
- // The cached system salt obtained from the cryptohome daemon.
+ // The cached system salt passed to the constructor, originally coming
+ // from cryptohome daemon.
std::string system_salt_;
// A key based on the system salt. Useful for encrypting device-level

Powered by Google App Engine
This is Rietveld 408576698