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

Unified Diff: sync/util/cryptographer.h

Issue 10540149: [Sync] Persist keystore key across restarts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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: sync/util/cryptographer.h
diff --git a/sync/util/cryptographer.h b/sync/util/cryptographer.h
index 633a1d13638643b1720fa514eb5027eea6986e1f..c1fecf0bf4f21f098a264d826aaca12df5d55c49 100644
--- a/sync/util/cryptographer.h
+++ b/sync/util/cryptographer.h
@@ -99,6 +99,10 @@ class Cryptographer {
// never call Bootstrap at all.
void Bootstrap(const std::string& restored_bootstrap_token);
+ // Bootstrap the keystore key.
+ void BootstrapKeystoreKey(
+ const std::string& restored_keystore_bootstrap_token);
+
// Returns whether we can decrypt |encrypted| using the keys we currently know
// about.
bool CanDecrypt(const sync_pb::EncryptedData& encrypted) const;
@@ -170,6 +174,9 @@ class Cryptographer {
// can't be created (i.e. if this Cryptograhper doesn't have valid keys).
bool GetBootstrapToken(std::string* token) const;
+ // Obtain the bootstrap token based on the keystore encryption key.
+ bool GetKeystoreKeyBootstrapToken(std::string* token) const;
+
// Update the cryptographer based on the contents of the nigori specifics.
// This updates both the encryption keys and the set of encrypted types.
// Returns NEEDS_PASSPHRASE if was unable to decrypt the pending keys,
@@ -187,7 +194,7 @@ class Cryptographer {
// Returns true if we currently have a keystore-derived nigori, false
// otherwise.
- bool HasKeystoreKey();
+ bool HasKeystoreKey() const;
// The set of types that are always encrypted.
static syncable::ModelTypeSet SensitiveTypes();

Powered by Google App Engine
This is Rietveld 408576698