| OLD | NEW |
| 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 #include "components/os_crypt/key_storage_linux.h" | 5 #include "components/os_crypt/key_storage_linux.h" |
| 6 | 6 |
| 7 #include "base/environment.h" | 7 #include "base/environment.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/nix/xdg_util.h" | 10 #include "base/nix/xdg_util.h" |
| 11 #include "components/os_crypt/key_storage_util_linux.h" | 11 #include "components/os_crypt/key_storage_util_linux.h" |
| 12 | 12 |
| 13 #if defined(USE_LIBSECRET) | 13 #if defined(USE_LIBSECRET) |
| 14 #include "components/os_crypt/key_storage_libsecret.h" | 14 #include "components/os_crypt/key_storage_libsecret.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 #if defined(USE_KWALLET) | 17 #if defined(USE_KWALLET) |
| 18 #include "components/os_crypt/key_storage_kwallet.h" | 18 #include "components/os_crypt/key_storage_kwallet.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 #if defined(OFFICIAL_BUILD) | 21 #if defined(GOOGLE_CHROME_BUILD) |
| 22 const char KeyStorageLinux::kFolderName[] = "Chrome Keys"; | 22 const char KeyStorageLinux::kFolderName[] = "Chrome Keys"; |
| 23 const char KeyStorageLinux::kKey[] = "Chrome Safe Storage"; | 23 const char KeyStorageLinux::kKey[] = "Chrome Safe Storage"; |
| 24 #else | 24 #else |
| 25 const char KeyStorageLinux::kFolderName[] = "Chromium Keys"; | 25 const char KeyStorageLinux::kFolderName[] = "Chromium Keys"; |
| 26 const char KeyStorageLinux::kKey[] = "Chromium Safe Storage"; | 26 const char KeyStorageLinux::kKey[] = "Chromium Safe Storage"; |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Parameters to OSCrypt, which are set before the first call to OSCrypt, are | 31 // Parameters to OSCrypt, which are set before the first call to OSCrypt, are |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 VLOG(1) << "OSCrypt using KWallet as backend."; | 91 VLOG(1) << "OSCrypt using KWallet as backend."; |
| 92 return key_storage; | 92 return key_storage; |
| 93 } | 93 } |
| 94 #endif | 94 #endif |
| 95 } | 95 } |
| 96 | 96 |
| 97 // The appropriate store was not available. | 97 // The appropriate store was not available. |
| 98 VLOG(1) << "OSCrypt could not initialize a backend."; | 98 VLOG(1) << "OSCrypt could not initialize a backend."; |
| 99 return nullptr; | 99 return nullptr; |
| 100 } | 100 } |
| OLD | NEW |