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

Unified Diff: sync/test/fake_sync_encryption_handler.cc

Issue 10916036: [Sync] Implement keystore migration support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 8 years, 4 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/test/fake_sync_encryption_handler.cc
diff --git a/sync/test/fake_sync_encryption_handler.cc b/sync/test/fake_sync_encryption_handler.cc
index 1dbdf8b75861c3fe6ad930af409cb9971622903f..3cf09081ee2399ce6a13f9ba7688811b658f53f1 100644
--- a/sync/test/fake_sync_encryption_handler.cc
+++ b/sync/test/fake_sync_encryption_handler.cc
@@ -26,13 +26,14 @@ void FakeSyncEncryptionHandler::ApplyNigoriUpdate(
syncable::BaseTransaction* const trans) {
if (nigori.encrypt_everything())
EnableEncryptEverything();
- if (nigori.using_explicit_passphrase())
+ if (nigori.frozen_keybag())
passphrase_state_ = CUSTOM_PASSPHRASE;
- if (cryptographer_.CanDecrypt(nigori.encrypted()))
- cryptographer_.InstallKeys(nigori.encrypted());
- else if (nigori.has_encrypted())
- cryptographer_.SetPendingKeys(nigori.encrypted());
+ // TODO(zea): consider adding fake support for migration.
+ if (cryptographer_.CanDecrypt(nigori.encryption_keybag()))
+ cryptographer_.InstallKeys(nigori.encryption_keybag());
+ else if (nigori.has_encryption_keybag())
+ cryptographer_.SetPendingKeys(nigori.encryption_keybag());
if (cryptographer_.has_pending_keys()) {
DVLOG(1) << "OnPassPhraseRequired Sent";

Powered by Google App Engine
This is Rietveld 408576698