diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-29 23:48:12 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-29 23:48:12 +0000 |
commit | de71c08fd406870753176a90f9fb84e3dbd645fa (patch) | |
tree | 2592190f8f028689a16e96ccf0e2ee2543456b74 /sync/test/fake_sync_encryption_handler.cc | |
parent | 118cfe57fe9e79b863f53be8500229adaf329334 (diff) | |
download | chromium_src-de71c08fd406870753176a90f9fb84e3dbd645fa.zip chromium_src-de71c08fd406870753176a90f9fb84e3dbd645fa.tar.gz chromium_src-de71c08fd406870753176a90f9fb84e3dbd645fa.tar.bz2 |
[Sync] Move keystore key handling to SyncEncryptionHandlerImpl
The cryptographer has no notion of keystore keys, and we now persist the
keystore key by reusing the OnBoostrapTokenUpdated method (which now takes
an enum as an extra param specifying the type of token).
BUG=129665
Review URL: https://chromiumcodereview.appspot.com/10878015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154007 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/test/fake_sync_encryption_handler.cc')
-rw-r--r-- | sync/test/fake_sync_encryption_handler.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sync/test/fake_sync_encryption_handler.cc b/sync/test/fake_sync_encryption_handler.cc index fd41a5c..1dbdf8b 100644 --- a/sync/test/fake_sync_encryption_handler.cc +++ b/sync/test/fake_sync_encryption_handler.cc @@ -57,6 +57,25 @@ void FakeSyncEncryptionHandler::UpdateNigoriFromEncryptedTypes( nigori); } +bool FakeSyncEncryptionHandler::NeedKeystoreKey( + syncable::BaseTransaction* const trans) const { + return keystore_key_.empty(); +} + +bool FakeSyncEncryptionHandler::SetKeystoreKey( + const std::string& key, + syncable::BaseTransaction* const trans) { + if (!keystore_key_.empty() || key.empty()) + return false; + keystore_key_ = key; + + DVLOG(1) << "Keystore bootstrap token updated."; + FOR_EACH_OBSERVER(SyncEncryptionHandler::Observer, observers_, + OnBootstrapTokenUpdated(key, + KEYSTORE_BOOTSTRAP_TOKEN)); + return true; +} + ModelTypeSet FakeSyncEncryptionHandler::GetEncryptedTypes( syncable::BaseTransaction* const trans) const { return encrypted_types_; |