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

Unified Diff: sync/util/cryptographer.cc

Issue 452283003: sync: Finish non-blocking type encryption support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More cryptographer testing Created 6 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
« no previous file with comments | « sync/util/cryptographer.h ('k') | sync/util/cryptographer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/util/cryptographer.cc
diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc
index cb155b5536e1c13fcd9030fdd35e4a8b6b9767ee..c22f0a322e6b0008f3f8aec3d336119aeb96594a 100644
--- a/sync/util/cryptographer.cc
+++ b/sync/util/cryptographer.cc
@@ -27,6 +27,24 @@ Cryptographer::Cryptographer(Encryptor* encryptor)
DCHECK(encryptor);
}
+Cryptographer::Cryptographer(const Cryptographer& other)
+ : encryptor_(other.encryptor_),
+ default_nigori_name_(other.default_nigori_name_) {
+ for (NigoriMap::const_iterator it = other.nigoris_.begin();
+ it != other.nigoris_.end();
+ ++it) {
+ std::string user_key, encryption_key, mac_key;
+ it->second->ExportKeys(&user_key, &encryption_key, &mac_key);
+ linked_ptr<Nigori> nigori_copy(new Nigori());
+ nigori_copy->InitByImport(user_key, encryption_key, mac_key);
+ nigoris_.insert(std::make_pair(it->first, nigori_copy));
+ }
+
+ if (other.pending_keys_) {
+ pending_keys_.reset(new sync_pb::EncryptedData(*(other.pending_keys_)));
+ }
+}
+
Cryptographer::~Cryptographer() {}
« no previous file with comments | « sync/util/cryptographer.h ('k') | sync/util/cryptographer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698