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

Issue 8770032: [Sync] Implement encryption-aware conflict resolution. (Closed)

Created:
9 years ago by Nicolas Zea
Modified:
9 years ago
CC:
chromium-reviews, Raghu Simha, ncarter (slow), akalin, tim (not reviewing), Paweł Hajdan Jr.
Visibility:
Public.

Description

[Sync] Implement encryption-aware conflict resolution. There are two primary changes in this patch. 1. Added a new syncable column PREV_SERVER_SPECIFICS. This field stores the most recent set of decryptable SERVER_SPECIFICS iff the current SERVER_SPECIFICS is not decryptable and only the specific have been modified. The field gets set in process_update_command and reset in conflict_resolver and process_update_command. 2. Due to the use of PREV_SERVER_SPECFICS, we now take into account whether a server change actually modified anything when we perform conflict resolution. If the current SERVER_SPECIFICS matches PREV_SERVER_SPECIFICS, irregardless of encryption, then we can overwrite the server data with the local data. This is possible because PREV_SERVER_SPECIFICS is only set when an update modifies specifics only (ignoring non_unique_name and mtime), and reset if a subsequent change modifies non-specifics data. As a result, we know that if PREV_SERVER_SPECIFICS are set, then we can determine whether a change is encryption only by inspecting SERVER_SPECIFICS alone. BUG=76596, 105615 TEST=sync_unit_tests. Manually getting into a state where a passphrase is needed but local changes are made, and then verifying that the local changes persist after the passphrase is supplied. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=115650

Patch Set 1 #

Patch Set 2 : diff against crypto patch #

Patch Set 3 : Fix unnecessary commits and ordering changes #

Patch Set 4 : Rebase #

Patch Set 5 : Some cleanup #

Patch Set 6 : Rebase and fix a nigori conflict case #

Patch Set 7 : Rebase + fix integration test #

Patch Set 8 : Split out nigori conflict code and rebase #

Total comments: 11

Patch Set 9 : Rebase and final cleanup #

Patch Set 10 : Fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+634 lines, -199 lines) Patch
M chrome/browser/sync/engine/apply_updates_command_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/engine/conflict_resolver.h View 1 2 3 4 5 6 7 8 1 chunk +13 lines, -0 lines 0 comments Download
M chrome/browser/sync/engine/conflict_resolver.cc View 1 2 3 4 5 6 7 8 9 chunks +106 lines, -25 lines 0 comments Download
M chrome/browser/sync/engine/get_commit_ids_command.cc View 1 2 3 4 5 6 7 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/sync/engine/process_updates_command.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/engine/process_updates_command.cc View 1 2 3 4 5 6 7 8 4 chunks +38 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/syncer_unittest.cc View 1 2 3 4 5 6 7 8 31 chunks +272 lines, -105 lines 0 comments Download
M chrome/browser/sync/engine/syncer_util.cc View 1 2 3 4 5 6 7 8 8 chunks +41 lines, -32 lines 0 comments Download
M chrome/browser/sync/syncable/directory_backing_store.h View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/sync/syncable/directory_backing_store.cc View 1 2 3 4 5 6 7 8 3 chunks +18 lines, -1 line 0 comments Download
M chrome/browser/sync/syncable/directory_backing_store_unittest.cc View 1 2 3 4 5 6 7 8 7 chunks +133 lines, -26 lines 0 comments Download
M chrome/browser/sync/syncable/syncable.h View 1 2 3 4 5 6 7 8 2 chunks +1 line, -1 line 0 comments Download
M chrome/browser/sync/syncable/syncable_columns.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/syncable/syncable_enum_conversions.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -5 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Nicolas Zea
I'm still going through some manual test cases with this, and need clean it up ...
9 years ago (2011-12-02 01:13:49 UTC) #1
Nicolas Zea
Oh, and the reason I went for the full specifics vs the hash we discussed ...
9 years ago (2011-12-02 01:14:59 UTC) #2
Nicolas Zea
Ready for review, PTAL. Note that this patch is diffed off http://codereview.chromium.org/8759019/.
9 years ago (2011-12-06 02:27:23 UTC) #3
Nicolas Zea
Ping! Went ahead and rebased as well as cleaned up some obsolete test expectations.
9 years ago (2011-12-09 22:55:12 UTC) #4
Nicolas Zea
I've gone ahead and updated the patch to diff against the nigori patch I sent ...
9 years ago (2011-12-14 01:15:28 UTC) #5
tim (not reviewing)
http://codereview.chromium.org/8770032/diff/26001/chrome/browser/sync/engine/conflict_resolver.cc File chrome/browser/sync/engine/conflict_resolver.cc (right): http://codereview.chromium.org/8770032/diff/26001/chrome/browser/sync/engine/conflict_resolver.cc#newcode109 chrome/browser/sync/engine/conflict_resolver.cc:109: // conflict encryption and not attempting to resolve). In ...
9 years ago (2011-12-15 20:55:11 UTC) #6
Nicolas Zea
Addressed the questions, will upload a patch soon that renames PREV_SERVER_SPECIFICS to BASE_SERVER_SPECIFICS and breaks ...
9 years ago (2011-12-16 19:25:14 UTC) #7
tim (not reviewing)
LGTM, pending BASE_ rename.
9 years ago (2011-12-20 15:45:25 UTC) #8
Nicolas Zea
Changes made, landing today. http://codereview.chromium.org/8770032/diff/26001/chrome/browser/sync/engine/process_updates_command.cc File chrome/browser/sync/engine/process_updates_command.cc (right): http://codereview.chromium.org/8770032/diff/26001/chrome/browser/sync/engine/process_updates_command.cc#newcode187 chrome/browser/sync/engine/process_updates_command.cc:187: target_entry.Put(syncable::PREV_SERVER_SPECIFICS, prev_specifics); On 2011/12/15 20:55:11, ...
9 years ago (2011-12-22 18:35:27 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zea@chromium.org/8770032/43003
9 years ago (2011-12-22 21:14:34 UTC) #10
commit-bot: I haz the power
9 years ago (2011-12-23 01:02:34 UTC) #11
Change committed as 115650

Powered by Google App Engine
This is Rietveld 408576698