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

Issue 423193002: sync: Add non-blocking type encryption support (Closed)

Created:
6 years, 4 months ago by rlarocque
Modified:
6 years, 4 months ago
Reviewers:
stanisc, Nicolas Zea
CC:
chromium-reviews, tim+watch_chromium.org, haitaol+watch_chromium.org, zea+watch_chromium.org, maniscalco+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

sync: Add non-blocking type encryption support Introduces the framework for dealing with sync encryption in non-blocking types. Unlike directory sync types, non-blocking type encryption only encrypts data before it is sent to the server. Encrypting the data on-disk is a separate problem. Adds code to the ModelTypeSyncWorker so it can access the directory's cryptographer (through a CryptographerProvider interface) and use it to encrypt entities before it sends them to the server. If the cryptographer is unable to encrypt with the desired key, the worker will not commit until the cryptographer returns to a good state. Adds the concept of a "desired encryption key" to the data type state. When the cryptographer key to be used to encrypt a type changes, this will be reflected in the data type state. The ModelTypeSyncProxy is responsible for ensuring that all items which have not yet been encrypted with this desired key are enqueued for commit. Makes the ModelTypeSyncWorker, EntityTracker, and ModelTypeSyncProxy collaborate on the management of undecryptable (inapplicable) updates. The EntityTracker keeps track of their version numbers and content, and prevents the committing of new items to the server until the inapplicable update has been dealt with. The ModelTypeSyncProxy is responsible for saving inapplicable updates across restarts. This CL alone is not enough to enable encryption support for non-blocking types. It requires additional code to hook up the ModelTypeSyncWorkers to receive cryptographer events. This will be added in a future commit. In the meantime, this CL includes plenty of unit tests to verify the functionality that's being added. BUG=351005 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287428

Patch Set 1 #

Total comments: 38

Patch Set 2 : First round of review fixes #

Patch Set 3 : Update GetDefaultNigori* function names #

Patch Set 4 : Renames #

Patch Set 5 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1244 lines, -87 lines) Patch
M components/sync_driver/non_blocking_data_type_controller_unittest.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M sync/engine/entity_tracker.h View 1 2 3 3 chunks +21 lines, -0 lines 0 comments Download
M sync/engine/entity_tracker.cc View 1 2 3 2 chunks +33 lines, -2 lines 0 comments Download
M sync/engine/model_type_entity.h View 1 2 3 5 chunks +17 lines, -4 lines 0 comments Download
M sync/engine/model_type_entity.cc View 1 2 3 8 chunks +27 lines, -9 lines 0 comments Download
M sync/engine/model_type_entity_unittest.cc View 5 chunks +12 lines, -6 lines 0 comments Download
M sync/engine/model_type_sync_proxy.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M sync/engine/model_type_sync_proxy_impl.h View 1 2 3 3 chunks +17 lines, -1 line 0 comments Download
M sync/engine/model_type_sync_proxy_impl.cc View 1 2 3 6 chunks +74 lines, -9 lines 0 comments Download
M sync/engine/model_type_sync_proxy_impl_unittest.cc View 1 2 3 9 chunks +230 lines, -4 lines 0 comments Download
M sync/engine/model_type_sync_worker_impl.h View 1 2 3 4 chunks +43 lines, -5 lines 0 comments Download
M sync/engine/model_type_sync_worker_impl.cc View 1 2 3 15 chunks +188 lines, -21 lines 0 comments Download
M sync/engine/model_type_sync_worker_impl_unittest.cc View 1 2 3 17 chunks +485 lines, -8 lines 0 comments Download
M sync/internal_api/public/non_blocking_sync_common.h View 1 3 chunks +6 lines, -1 line 0 comments Download
M sync/internal_api/public/sync_context.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M sync/internal_api/public/sync_context_proxy.h View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M sync/internal_api/public/test/null_sync_context_proxy.h View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M sync/internal_api/sync_context_proxy_impl.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M sync/internal_api/sync_context_proxy_impl.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M sync/internal_api/sync_encryption_handler_impl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/test/null_sync_context_proxy.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M sync/sessions/model_type_registry.h View 1 2 3 4 chunks +6 lines, -1 line 0 comments Download
M sync/sessions/model_type_registry.cc View 1 2 3 6 chunks +16 lines, -5 lines 0 comments Download
M sync/sessions/model_type_registry_unittest.cc View 5 chunks +6 lines, -0 lines 0 comments Download
M sync/test/engine/injectable_sync_context_proxy.h View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M sync/test/engine/injectable_sync_context_proxy.cc View 1 chunk +1 line, -0 lines 0 comments Download
M sync/test/engine/mock_model_type_sync_proxy.h View 1 2 3 4 chunks +6 lines, -2 lines 0 comments Download
M sync/test/engine/mock_model_type_sync_proxy.cc View 1 2 3 3 chunks +13 lines, -3 lines 0 comments Download
M sync/test/engine/mock_model_type_sync_worker.h View 2 chunks +8 lines, -0 lines 0 comments Download
M sync/test/engine/mock_model_type_sync_worker.cc View 3 chunks +9 lines, -0 lines 0 comments Download
M sync/util/cryptographer.h View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M sync/util/cryptographer.cc View 1 2 2 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
rlarocque
Here's the bulk of the encryption code. It's a big CL, but more than half ...
6 years, 4 months ago (2014-07-29 21:03:22 UTC) #1
stanisc
https://codereview.chromium.org/423193002/diff/1/sync/engine/entity_tracker.h File sync/engine/entity_tracker.h (right): https://codereview.chromium.org/423193002/diff/1/sync/engine/entity_tracker.h#newcode166 sync/engine/entity_tracker.h:166: // An update for this item which can't be ...
6 years, 4 months ago (2014-07-30 00:30:05 UTC) #2
Nicolas Zea
https://codereview.chromium.org/423193002/diff/1/sync/engine/entity_tracker.cc File sync/engine/entity_tracker.cc (right): https://codereview.chromium.org/423193002/diff/1/sync/engine/entity_tracker.cc#newcode196 sync/engine/entity_tracker.cc:196: if (version > highest_gu_response_version_) { It seems like it ...
6 years, 4 months ago (2014-07-30 00:34:16 UTC) #3
rlarocque
Here are responses to the first round of reviews. Patch is updated, too. PTAL. https://codereview.chromium.org/423193002/diff/1/sync/engine/entity_tracker.cc ...
6 years, 4 months ago (2014-07-30 21:56:01 UTC) #4
stanisc
https://codereview.chromium.org/423193002/diff/1/sync/util/cryptographer.h File sync/util/cryptographer.h (right): https://codereview.chromium.org/423193002/diff/1/sync/util/cryptographer.h#newcode180 sync/util/cryptographer.h:180: std::string GetDefaultKeyName() const; On 2014/07/30 21:56:01, rlarocque wrote: > ...
6 years, 4 months ago (2014-07-30 22:20:55 UTC) #5
rlarocque
https://codereview.chromium.org/423193002/diff/1/sync/util/cryptographer.h File sync/util/cryptographer.h (right): https://codereview.chromium.org/423193002/diff/1/sync/util/cryptographer.h#newcode180 sync/util/cryptographer.h:180: std::string GetDefaultKeyName() const; On 2014/07/30 22:20:55, stanisc wrote: > ...
6 years, 4 months ago (2014-07-30 22:28:48 UTC) #6
Nicolas Zea
https://codereview.chromium.org/423193002/diff/1/sync/engine/entity_tracker.h File sync/engine/entity_tracker.h (right): https://codereview.chromium.org/423193002/diff/1/sync/engine/entity_tracker.h#newcode166 sync/engine/entity_tracker.h:166: // An update for this item which can't be ...
6 years, 4 months ago (2014-07-31 18:06:27 UTC) #7
rlarocque
https://codereview.chromium.org/423193002/diff/1/sync/engine/model_type_entity.h File sync/engine/model_type_entity.h (right): https://codereview.chromium.org/423193002/diff/1/sync/engine/model_type_entity.h#newcode92 sync/engine/model_type_entity.h:92: void RequireEncryptionKey(const std::string& name); On 2014/07/31 18:06:26, Nicolas Zea ...
6 years, 4 months ago (2014-07-31 18:14:38 UTC) #8
Nicolas Zea
On 2014/07/31 18:14:38, rlarocque wrote: > https://codereview.chromium.org/423193002/diff/1/sync/engine/model_type_entity.h > File sync/engine/model_type_entity.h (right): > > https://codereview.chromium.org/423193002/diff/1/sync/engine/model_type_entity.h#newcode92 > ...
6 years, 4 months ago (2014-07-31 18:26:53 UTC) #9
rlarocque
Patch updated with renames. PTAL. https://codereview.chromium.org/423193002/diff/1/sync/engine/entity_tracker.h File sync/engine/entity_tracker.h (right): https://codereview.chromium.org/423193002/diff/1/sync/engine/entity_tracker.h#newcode166 sync/engine/entity_tracker.h:166: // An update for ...
6 years, 4 months ago (2014-07-31 18:54:04 UTC) #10
stanisc
lgtm
6 years, 4 months ago (2014-08-01 19:10:15 UTC) #11
Nicolas Zea
lgtm
6 years, 4 months ago (2014-08-04 18:05:23 UTC) #12
rlarocque
The CQ bit was checked by rlarocque@chromium.org
6 years, 4 months ago (2014-08-04 18:19:36 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/423193002/80001
6 years, 4 months ago (2014-08-04 18:24:49 UTC) #14
commit-bot: I haz the power
Change committed as 287428
6 years, 4 months ago (2014-08-05 01:06:55 UTC) #15
Lei Zhang
6 years, 4 months ago (2014-08-05 02:15:38 UTC) #16
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/442623002/ by thestig@chromium.org.

The reason for reverting is: Both LSAN and Valgrind complains about leaks in the
tests..

Powered by Google App Engine
This is Rietveld 408576698