Add PASSWORDS sync support to pseudo-USS

PASSWORDS is the only remaining datatype that hasn't been wrapped in
pseudo-USS and also the most difficult one, due to the encryption-
related particularities (entities must be encrypted at all times).
The proposal is described in a dedicated section in the Design Doc:
https://docs.google.com/document/d/14ScYZ0sop921gjBwXuReIEuQJlwftqkuSM1jMK_A_x4/edit#heading=h.ev0xr4j8pkot

The patch includes the USS variant of the datatype controller for
passwords, together with the required plumbing to enable
directory-level (SyncableServiceBasedBridge) encryption of data.
Cryptographer updates are posted from the sync thread directly to the
model thread (password's background thread) with a newly introduced
proxy observer, such that the bridge is up-to-date by the time the
processor receives updates. A refcounted class (interface
ModelCryptographer) is used for the plumbing to the bridge, due to
the complex lifetime conditions of the involved parts.

All this code is behind experimental feature toggle
"SyncPseudoUSSPasswords".

Because of encryption-related particularities of PASSWORDS, special
care is taken with integration tests, and all tests with or without
pseudo-USS enabled, including backward-compatibility tests that exercise
legacy clients talking to pseudo-USS-enabled clients (and vice versa).

Bug: 870624
Change-Id: I3e9ecc36d0b27c4c28e98fa709e7d13f9fb5a025
Reviewed-on: https://chromium-review.googlesource.com/c/1289889
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601736}
19 files changed