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

Issue 1973483002: OSCrypt for POSIX uses libsecret to store a randomised encryption key. (Closed)

Created:
4 years, 7 months ago by cfroussios
Modified:
4 years, 6 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement OSCrypt for Linux. OSCrypt for linux uses libsecret to store a randomised encryption key. Mentions of OSCrypt below refer to the linux version. OSCrypt now supports a new version of encryption. If libsecret is available, then a randomised password will be generated, stored in libsecret and used for producing encryption keys. The old ways of encrypting, i.e. using a hardcoded password and using no encryption at all, are still supported. Data encrypted with the new version are marked with a version prefix, "v11". That is an increment on the previous prefix, "v10", which separated data that was encrypted with the hardcoded password from data that were not encrypted. To separate this new linux feature from the generic posix implementation, a new implementation for OSCrypt was created in os_crypt_linux.cc. Since there is support on the way for more services in addition to libsecret (gnome keyring, kwallet), interaction with such services is abstracted with the KeyStorageLinux API. The libsecret utilities that KeyStorageLinux uses (i.e. LibsecretLoader) are also used by the PasswordManager. Here we only actually need a subset of their features. Once PasswordManager stops depending on them, they can be simplified and/or hidden in the KeyStorageLibsecret implementation. BUG=602624 Committed: https://crrev.com/3b5a4e4f0f10e73b9ace1e61079b099a9e62b1d8 Cr-Commit-Position: refs/heads/master@{#396814}

Patch Set 1 #

Patch Set 2 : Removed unused variable causing compilation errors #

Patch Set 3 : Refactored CL #

Total comments: 72

Patch Set 4 : Fix for chromeos build #

Patch Set 5 : Fixed dependency from PasswordManager #

Patch Set 6 : Recommended refactoring #

Patch Set 7 : Fixed memory leak #

Patch Set 8 : Fixed lsan failure #

Total comments: 74

Patch Set 9 : Applied recommendations #

Patch Set 10 : Fix for non-linux builds #

Patch Set 11 : Nit #

Total comments: 16

Patch Set 12 : Recommendations #

Patch Set 13 : Reduced mocking boilerplate #

Patch Set 14 : Fix for non-linux #

Patch Set 15 : More fix for non-linux #

Total comments: 17

Patch Set 16 : Recommendations #

Total comments: 45

Patch Set 17 : Recommendations #

Patch Set 18 : Fixed asan #

Total comments: 6

Patch Set 19 : Synced with master (OSCryptMocker) #

Patch Set 20 : #

Total comments: 4

Patch Set 21 : Recommendations #

Unified diffs Side-by-side diffs Delta from patch set Stats (+839 lines, -242 lines) Patch
M chrome/browser/password_manager/native_backend_libsecret.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +12 lines, -0 lines 0 comments Download
M components/os_crypt.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +17 lines, -4 lines 0 comments Download
M components/os_crypt/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +17 lines, -2 lines 0 comments Download
A components/os_crypt/key_storage_libsecret.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +30 lines, -0 lines 0 comments Download
A components/os_crypt/key_storage_libsecret.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +66 lines, -0 lines 0 comments Download
A components/os_crypt/key_storage_linux.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +36 lines, -0 lines 0 comments Download
A components/os_crypt/key_storage_linux.cc View 1 2 3 4 5 6 7 8 1 chunk +17 lines, -0 lines 0 comments Download
A + components/os_crypt/libsecret_util_linux.h View 1 2 3 3 chunks +8 lines, -7 lines 0 comments Download
A + components/os_crypt/libsecret_util_linux.cc View 1 2 3 4 5 6 7 8 4 chunks +23 lines, -10 lines 0 comments Download
M components/os_crypt/libsecret_util_posix.h View 1 2 3 1 chunk +0 lines, -83 lines 0 comments Download
M components/os_crypt/libsecret_util_posix.cc View 1 2 3 1 chunk +0 lines, -134 lines 0 comments Download
M components/os_crypt/os_crypt.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +16 lines, -1 line 0 comments Download
A components/os_crypt/os_crypt_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +235 lines, -0 lines 0 comments Download
A components/os_crypt/os_crypt_linux_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +70 lines, -0 lines 0 comments Download
M components/os_crypt/os_crypt_mocker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +8 lines, -0 lines 0 comments Download
A components/os_crypt/os_crypt_mocker_linux.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +48 lines, -0 lines 0 comments Download
A components/os_crypt/os_crypt_mocker_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +58 lines, -0 lines 0 comments Download
A components/os_crypt/os_crypt_util_linux_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +177 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (17 generated)
cfroussios
Hi vabr. Can you give quick feedback on this before I pass it to the ...
4 years, 7 months ago (2016-05-13 11:52:37 UTC) #2
cfroussios
4 years, 7 months ago (2016-05-13 13:14:41 UTC) #4
vabr (Chromium)
Thanks, Christos. I'm really glad to see this progress! I left some comments, some of ...
4 years, 7 months ago (2016-05-13 15:10:19 UTC) #7
cfroussios
https://codereview.chromium.org/1973483002/diff/40001/components/os_crypt/key_storage_linux.cc File components/os_crypt/key_storage_linux.cc (right): https://codereview.chromium.org/1973483002/diff/40001/components/os_crypt/key_storage_linux.cc#newcode12 components/os_crypt/key_storage_linux.cc:12: #ifdef OFFICIAL_BUILD On 2016/05/13 15:10:17, vabr (OOO until 22 ...
4 years, 7 months ago (2016-05-13 17:09:13 UTC) #8
cfroussios
thestig@chromium.org: Please review changes in os_crypt/ I implemented libsecret support in os_crypt. I'm sorry that ...
4 years, 7 months ago (2016-05-18 13:08:54 UTC) #11
Lei Zhang
https://codereview.chromium.org/1973483002/diff/140001/components/components_tests.gyp File components/components_tests.gyp (right): https://codereview.chromium.org/1973483002/diff/140001/components/components_tests.gyp#newcode462 components/components_tests.gyp:462: 'os_crypt/os_crypt_util_linux_unittest.cc', Alphabetical order please. Ditto below. https://codereview.chromium.org/1973483002/diff/140001/components/os_crypt.gypi File components/os_crypt.gypi ...
4 years, 7 months ago (2016-05-18 22:38:17 UTC) #13
cfroussios
Hi. Thanks for the feedback. Can you have a look again? https://codereview.chromium.org/1973483002/diff/140001/components/components_tests.gyp File components/components_tests.gyp (right): ...
4 years, 7 months ago (2016-05-19 21:18:19 UTC) #14
Lei Zhang
Getting closer. https://codereview.chromium.org/1973483002/diff/140001/components/os_crypt/key_storage_mock.cc File components/os_crypt/key_storage_mock.cc (right): https://codereview.chromium.org/1973483002/diff/140001/components/os_crypt/key_storage_mock.cc#newcode14 components/os_crypt/key_storage_mock.cc:14: base::Base64Encode(base::RandBytesAsString(128 / 8), &key_); On 2016/05/19 21:18:18, ...
4 years, 7 months ago (2016-05-19 22:45:39 UTC) #15
cfroussios
Hi. Thanks for the feedback again! I changed the way mocking is requested a bit ...
4 years, 7 months ago (2016-05-20 16:44:52 UTC) #18
Lei Zhang
Getting closer. https://codereview.chromium.org/1973483002/diff/320001/components/os_crypt/os_crypt_mocker_linux.cc File components/os_crypt/os_crypt_mocker_linux.cc (right): https://codereview.chromium.org/1973483002/diff/320001/components/os_crypt/os_crypt_mocker_linux.cc#newcode11 components/os_crypt/os_crypt_mocker_linux.cc:11: namespace { Add blank line after. https://codereview.chromium.org/1973483002/diff/320001/components/os_crypt/os_crypt_mocker_linux.cc#newcode19 ...
4 years, 7 months ago (2016-05-20 21:15:34 UTC) #19
sevenfold1999AC
lgtm https://codereview.chromium.org/1973483002/diff/320001/components/os_crypt/os_crypt_mocker_linux.h File components/os_crypt/os_crypt_mocker_linux.h (right): https://codereview.chromium.org/1973483002/diff/320001/components/os_crypt/os_crypt_mocker_linux.h#newcode11 components/os_crypt/os_crypt_mocker_linux.h:11: #include "base/memory/singleton.h" On 2016/05/20 21:15:33, Lei Zhang wrote: ...
4 years, 7 months ago (2016-05-22 07:13:46 UTC) #21
sevenfold1999AC
lgtm
4 years, 7 months ago (2016-05-22 07:15:31 UTC) #23
cfroussios
https://codereview.chromium.org/1973483002/diff/320001/components/os_crypt/os_crypt_mocker_linux.cc File components/os_crypt/os_crypt_mocker_linux.cc (right): https://codereview.chromium.org/1973483002/diff/320001/components/os_crypt/os_crypt_mocker_linux.cc#newcode11 components/os_crypt/os_crypt_mocker_linux.cc:11: namespace { On 2016/05/20 21:15:33, Lei Zhang wrote: > ...
4 years, 7 months ago (2016-05-23 09:31:22 UTC) #26
vabr (Chromium)
LGTM with some comments. https://codereview.chromium.org/1973483002/diff/340001/components/os_crypt/key_storage_libsecret.h File components/os_crypt/key_storage_libsecret.h (right): https://codereview.chromium.org/1973483002/diff/340001/components/os_crypt/key_storage_libsecret.h#newcode13 components/os_crypt/key_storage_libsecret.h:13: // Specialisation of |KeyStorage| that ...
4 years, 7 months ago (2016-05-23 12:38:33 UTC) #27
cfroussios
Hi. I addressed the comments. I also updated OSCryptMocker with the linux implementation that is ...
4 years, 6 months ago (2016-05-30 11:50:17 UTC) #28
vabr (Chromium)
I still have a question about MockSecretValue, and some more nits, but otherwise LGTM. Cheers, ...
4 years, 6 months ago (2016-05-30 15:05:38 UTC) #29
cfroussios
I addressed your comments and explained what I mean by symmetry. If you're still not ...
4 years, 6 months ago (2016-05-30 16:19:41 UTC) #30
vabr (Chromium)
LGTM, thanks! https://codereview.chromium.org/1973483002/diff/340001/components/os_crypt/os_crypt_util_linux_unittest.cc File components/os_crypt/os_crypt_util_linux_unittest.cc (right): https://codereview.chromium.org/1973483002/diff/340001/components/os_crypt/os_crypt_util_linux_unittest.cc#newcode20 components/os_crypt/os_crypt_util_linux_unittest.cc:20: using MockSecretValue = std::string; On 2016/05/30 16:19:41, ...
4 years, 6 months ago (2016-05-30 18:00:47 UTC) #31
Lei Zhang
lgtm https://codereview.chromium.org/1973483002/diff/420001/components/os_crypt/os_crypt_linux.cc File components/os_crypt/os_crypt_linux.cc (right): https://codereview.chromium.org/1973483002/diff/420001/components/os_crypt/os_crypt_linux.cc#newcode95 components/os_crypt/os_crypt_linux.cc:95: std::string* (*get_password[])() = { g_get_password? https://codereview.chromium.org/1973483002/diff/420001/components/os_crypt/os_crypt_linux.cc#newcode218 components/os_crypt/os_crypt_linux.cc:218: *get_password_save[sizeof(get_password) ...
4 years, 6 months ago (2016-05-30 20:57:09 UTC) #32
cfroussios
Thanks all for the feedback! https://codereview.chromium.org/1973483002/diff/340001/components/os_crypt/os_crypt_util_linux_unittest.cc File components/os_crypt/os_crypt_util_linux_unittest.cc (right): https://codereview.chromium.org/1973483002/diff/340001/components/os_crypt/os_crypt_util_linux_unittest.cc#newcode20 components/os_crypt/os_crypt_util_linux_unittest.cc:20: using MockSecretValue = std::string; ...
4 years, 6 months ago (2016-05-31 10:56:11 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1973483002/440001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1973483002/440001
4 years, 6 months ago (2016-05-31 10:57:56 UTC) #36
commit-bot: I haz the power
Committed patchset #21 (id:440001)
4 years, 6 months ago (2016-05-31 11:02:30 UTC) #38
commit-bot: I haz the power
4 years, 6 months ago (2016-05-31 11:03:52 UTC) #40
Message was sent while issue was closed.
Patchset 21 (id:??) landed as
https://crrev.com/3b5a4e4f0f10e73b9ace1e61079b099a9e62b1d8
Cr-Commit-Position: refs/heads/master@{#396814}

Powered by Google App Engine
This is Rietveld 408576698