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

Side by Side Diff: components/os_crypt/key_storage_util_linux.h

Issue 2948783002: Create setting that disables password stores (Closed)
Patch Set: lint Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_OS_CRYPT_KEY_STORAGE_UTIL_LINUX_H_ 5 #ifndef COMPONENTS_OS_CRYPT_KEY_STORAGE_UTIL_LINUX_H_
6 #define COMPONENTS_OS_CRYPT_KEY_STORAGE_UTIL_LINUX_H_ 6 #define COMPONENTS_OS_CRYPT_KEY_STORAGE_UTIL_LINUX_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/nix/xdg_util.h" 10 #include "base/nix/xdg_util.h"
11 11
12 namespace base {
13 class FilePath;
14 }
15
12 namespace os_crypt { 16 namespace os_crypt {
13 17
14 // The supported Linux backends for storing passwords. 18 // The supported Linux backends for storing passwords.
15 enum class SelectedLinuxBackend { 19 enum class SelectedLinuxBackend {
16 DEFER, // No selection 20 DEFER, // No selection
17 BASIC_TEXT, 21 BASIC_TEXT,
18 GNOME_ANY, // GNOME_KEYRING or GNOME_LIBSECRET, whichever is available. 22 GNOME_ANY, // GNOME_KEYRING or GNOME_LIBSECRET, whichever is available.
19 GNOME_KEYRING, 23 GNOME_KEYRING,
20 GNOME_LIBSECRET, 24 GNOME_LIBSECRET,
21 KWALLET, 25 KWALLET,
22 KWALLET5, 26 KWALLET5,
23 }; 27 };
24 28
25 // Decide which backend to target. |type| is checked first. If it does not 29 // Decide which backend to target. |type| is checked first. If it does not
26 // match a supported backend, |desktop_env| will be used to decide. 30 // match a supported backend and |use_backend| is true, |desktop_env| will be
31 // used to decide.
27 // TODO(crbug/571003): This is exposed as a utility only for password manager to 32 // TODO(crbug/571003): This is exposed as a utility only for password manager to
28 // use. It should be merged into key_storage_linux, once no longer needed in 33 // use. It should be merged into key_storage_linux, once no longer needed in
29 // password manager. 34 // password manager.
30 SelectedLinuxBackend SelectBackend(const std::string& type, 35 SelectedLinuxBackend SelectBackend(const std::string& type,
36 bool use_backend,
31 base::nix::DesktopEnvironment desktop_env); 37 base::nix::DesktopEnvironment desktop_env);
32 38
39 // Set the setting that disables using OS-level encryption.
40 bool WriteBackendUse(const base::FilePath& user_data_dir, bool use);
vabr (Chromium) 2017/07/03 19:27:14 nit: Let's be clearer about the meaning of |use|.
cfroussios 2017/07/04 09:58:15 Done.
41
42 // Decide whether the backend should be used based on the setting.
43 bool GetBackendUse(const base::FilePath& user_data_dir);
44
33 } // namespace os_crypt 45 } // namespace os_crypt
34 46
35 #endif // COMPONENTS_OS_CRYPT_KEY_STORAGE_UTIL_LINUX_H_ 47 #endif // COMPONENTS_OS_CRYPT_KEY_STORAGE_UTIL_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698