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

Unified Diff: chrome/browser/sync/engine/nigori_util.cc

Issue 7878005: [Sync] Fix encrypting of sync titles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and add comment Created 9 years, 3 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 | « no previous file | chrome/browser/sync/engine/syncer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/nigori_util.cc
diff --git a/chrome/browser/sync/engine/nigori_util.cc b/chrome/browser/sync/engine/nigori_util.cc
index e84e13d21d1904dbbda2582bf6094265e22af104..7edd51496e39ea5ce048141ee15b5df953cb22f5 100644
--- a/chrome/browser/sync/engine/nigori_util.cc
+++ b/chrome/browser/sync/engine/nigori_util.cc
@@ -59,7 +59,15 @@ bool EntryNeedsEncryption(const ModelTypeSet& encrypted_types,
const Entry& entry) {
if (!entry.Get(UNIQUE_SERVER_TAG).empty())
return false; // We don't encrypt unique server nodes.
- return SpecificsNeedsEncryption(encrypted_types, entry.Get(SPECIFICS));
+ syncable::ModelType type = entry.GetModelType();
+ if (type == PASSWORDS || type == NIGORI)
+ return false;
+ // Checking NON_UNIQUE_NAME is not necessary for the correctness of encrypting
+ // the data, nor for determining if data is encrypted. We simply ensure it has
+ // been overwritten to avoid any possible leaks of sensitive data.
+ return SpecificsNeedsEncryption(encrypted_types, entry.Get(SPECIFICS)) ||
+ (encrypted_types.count(type) > 0 &&
+ entry.Get(NON_UNIQUE_NAME) != kEncryptedString);
}
bool SpecificsNeedsEncryption(const ModelTypeSet& encrypted_types,
« no previous file with comments | « no previous file | chrome/browser/sync/engine/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698