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

Issue 2260953002: Supplimentary identifier for passwords specific (Closed)

Created:
4 years, 4 months ago by melandory
Modified:
4 years, 3 months ago
Reviewers:
Nicolas Zea
CC:
chromium-reviews, sync-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Supplimentary identifier for passwords specific BUG=638963

Patch Set 1 #

Patch Set 2 : cleanup #

Patch Set 3 : cl format #

Total comments: 5

Patch Set 4 : ... #

Patch Set 5 : pof #

Patch Set 6 : POF, Vault #

Patch Set 7 : cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -158 lines) Patch
M components/sync/core/sync_encryption_handler.h View 1 2 3 4 5 6 1 chunk +0 lines, -4 lines 0 comments Download
M components/sync/core_impl/sync_encryption_handler_impl.h View 1 2 3 4 5 6 chunks +12 lines, -7 lines 0 comments Download
M components/sync/core_impl/sync_encryption_handler_impl.cc View 1 2 3 4 5 6 27 chunks +90 lines, -66 lines 0 comments Download
M components/sync/core_impl/sync_encryption_handler_impl_unittest.cc View 1 2 3 4 5 6 36 chunks +49 lines, -71 lines 0 comments Download
M components/sync/core_impl/sync_manager_impl_unittest.cc View 1 2 3 4 5 6 7 chunks +19 lines, -8 lines 0 comments Download
M components/sync/syncable/nigori_handler.h View 1 2 3 4 5 6 2 chunks +7 lines, -0 lines 0 comments Download
M components/sync/test/fake_sync_encryption_handler.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M components/sync/test/fake_sync_encryption_handler.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 31 (24 generated)
melandory
Hey, can you take a quick look and comment on approach, while I'm trying to ...
4 years, 4 months ago (2016-08-19 23:57:00 UTC) #10
Nicolas Zea
https://codereview.chromium.org/2260953002/diff/40001/components/sync/core/write_node.cc File components/sync/core/write_node.cc (right): https://codereview.chromium.org/2260953002/diff/40001/components/sync/core/write_node.cc#newcode150 components/sync/core/write_node.cc:150: const sync_pb::PasswordSpecificsMetadata& specifics) {} I wonder if we really ...
4 years, 4 months ago (2016-08-20 00:23:43 UTC) #11
melandory
https://codereview.chromium.org/2260953002/diff/40001/components/sync/core_impl/sync_encryption_handler_impl.cc File components/sync/core_impl/sync_encryption_handler_impl.cc (right): https://codereview.chromium.org/2260953002/diff/40001/components/sync/core_impl/sync_encryption_handler_impl.cc#newcode854 components/sync/core_impl/sync_encryption_handler_impl.cc:854: child.SetPasswordSpecificsMetadata( On 2016/08/20 00:23:43, Nicolas Zea wrote: > It ...
4 years, 4 months ago (2016-08-22 22:08:41 UTC) #14
Nicolas Zea
On 2016/08/22 22:08:41, melandory wrote: > https://codereview.chromium.org/2260953002/diff/40001/components/sync/core_impl/sync_encryption_handler_impl.cc > File components/sync/core_impl/sync_encryption_handler_impl.cc (right): > > https://codereview.chromium.org/2260953002/diff/40001/components/sync/core_impl/sync_encryption_handler_impl.cc#newcode854 > ...
4 years, 4 months ago (2016-08-22 23:50:05 UTC) #15
melandory
On 2016/08/22 23:50:05, Nicolas Zea wrote: > On 2016/08/22 22:08:41, melandory wrote: > > > ...
4 years, 4 months ago (2016-08-24 00:41:59 UTC) #22
Nicolas Zea
On 2016/08/24 00:41:59, melandory wrote: > On 2016/08/22 23:50:05, Nicolas Zea wrote: > > On ...
4 years, 4 months ago (2016-08-24 01:27:12 UTC) #24
melandory
4 years, 3 months ago (2016-08-26 16:01:04 UTC) #31
On 2016/08/24 01:27:12, Nicolas Zea wrote:
> On 2016/08/24 00:41:59, melandory wrote:
> > On 2016/08/22 23:50:05, Nicolas Zea wrote:
> > > On 2016/08/22 22:08:41, melandory wrote:
> > > >
> > >
> >
>
https://codereview.chromium.org/2260953002/diff/40001/components/sync/core_im...
> > > > File components/sync/core_impl/sync_encryption_handler_impl.cc (right):
> > > > 
> > > >
> > >
> >
>
https://codereview.chromium.org/2260953002/diff/40001/components/sync/core_im...
> > > > components/sync/core_impl/sync_encryption_handler_impl.cc:854:
> > > > child.SetPasswordSpecificsMetadata(
> > > > On 2016/08/20 00:23:43, Nicolas Zea wrote:
> > > > > It occurs to me that I don't think you need this. SetPasswordSpecifics
> > above
> > > > > should automatically clear this as necessary (see my comment in
> > > > write_node.cc).
> > > > > You'll need to make some changes to nigori_util.cc to make that
happen.
> > > > 
> > > > Disclaimer. Text below is written with an assumption of following setup:

> > > > * data is cleared in nigori_util, UpdateEntryWithEncryption
> > > > * in order to get encryption state we query
> NigoriHandler::GetEncryptedTypes
> > > and
> > > > if encrypted types equal to EncryptableUserTypes, then it is custom
> > passphrase
> > > > user .
> > > > 
> > > > So there is one thing which bothers me in proposed approach (or at least
> > about
> > > > implementation I described).
> > > > 
> > > > Information that if user has custom_passphrase when "encrypt everything"
> is
> > > true
> > > > is external to the UpdateEntryWithEncryption and I think currently there
> is
> > no
> > > > tests which check that this hypothesis is always true.
> > > > 
> > > > I see several ways to solve this:
> > > > 1. Pipe passphrase_type_ flag to UpdateEntryWithEncryption.
> > > > 2. Keep clearing of data in sync_encryption_handler_impl.cc, where we
have
> > > > explicit signal about passphrase type.
> > > > 3. Do implementation as written in the paragraph above and try to come
up
> > with
> > > a
> > > > solution for testing that custom passphrase state == encrypt everything
> > state.
> > > > 
> > > > WDYT?
> > > 
> > > Good question. In general this is a bit of an issue in the codebase.
> > Passphrase
> > > type state and encrypted type state, although from a user perspective are
> > > coupled, within the code they're independent.
> > > 
> > > I think I favor plumbing the passphrase type in, and just having DCHECKs.
> That
> > > makes things more explicit, although might involve touching a number of
> > > callsites and tests.
> > 
> > PTAL, if approach looks fine I'll continue with plumbing.
> 
> Looking at this, I think this might be trickier than I initially thought. In
> particular, the GenericChangeProcessor, which can be called from any thread,
> does not have direct access to the passphrase type. It can only get access to
> the set of encrypted types via the NigoriHandler. There is no thread-safe way
to
> get the passphrase type right now. And, the set of encrypted types can
actually
> be more than just the sensitive types if for some reason a new version of
Chrome
> were to redefine what the sensitive types were, so just looking at the
encrypted
> types isn't a good way to go.
> 
> Fundamentally, what we need to do is either make a new thread-safe version of
> PassphraseType accessible (similar to the GetEncryptedTypes method in
> NigoriHandler), or ensure this work of setting/clearing the metadata field
only
> happens on the sync thread (e.g. the same thread RencryptEverything or our
> communication with the sync server happens on). Of these two options, I prefer
> exposing a thread-safe version, which then ensures that what we persist into
the
> sync directory reflects what we send to the server (and any of the idempotency
> checks we have in the code don't get confused).
> 
> I recommend taking a look at the Vault structure in SyncEncryptionHandlerImpl.
> Maybe we should have the passphrase type in there?

CL becomes too big, so here is the split:

* Mostly mechanical change which makes "enum" an "enum class":
https://codereview.chromium.org/2279713002/
* Moving PassphraseType to the separate header:
https://codereview.chromium.org/2279753003/
* Adding passphrase_type to Vault: https://codereview.chromium.org/2278043003/
* Introducing new field in proto, clearing on ReEncryption event:
https://codereview.chromium.org/2278333002
* Passing correct parameters in GenericChangeProessor: still WIP,
https://codereview.chromium.org/2285753002

Powered by Google App Engine
This is Rietveld 408576698