| 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_libsecret.h" | 5 #include "components/os_crypt/key_storage_libsecret.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "components/os_crypt/libsecret_util_linux.h" | 10 #include "components/os_crypt/libsecret_util_linux.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 #if defined(OFFICIAL_BUILD) | 14 #if defined(GOOGLE_CHROME_BUILD) |
| 15 const char kKeyStorageEntryName[] = "Chrome Safe Storage"; | 15 const char kKeyStorageEntryName[] = "Chrome Safe Storage"; |
| 16 #else | 16 #else |
| 17 const char kKeyStorageEntryName[] = "Chromium Safe Storage"; | 17 const char kKeyStorageEntryName[] = "Chromium Safe Storage"; |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 const SecretSchema kKeystoreSchema = { | 20 const SecretSchema kKeystoreSchema = { |
| 21 "chrome_libsecret_os_crypt_password", | 21 "chrome_libsecret_os_crypt_password", |
| 22 SECRET_SCHEMA_NONE, | 22 SECRET_SCHEMA_NONE, |
| 23 { | 23 { |
| 24 {nullptr, SECRET_SCHEMA_ATTRIBUTE_STRING}, | 24 {nullptr, SECRET_SCHEMA_ATTRIBUTE_STRING}, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 std::string password( | 58 std::string password( |
| 59 LibsecretLoader::secret_value_get_text(password_libsecret)); | 59 LibsecretLoader::secret_value_get_text(password_libsecret)); |
| 60 LibsecretLoader::secret_value_unref(password_libsecret); | 60 LibsecretLoader::secret_value_unref(password_libsecret); |
| 61 return password; | 61 return password; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool KeyStorageLibsecret::Init() { | 64 bool KeyStorageLibsecret::Init() { |
| 65 return LibsecretLoader::EnsureLibsecretLoaded(); | 65 return LibsecretLoader::EnsureLibsecretLoaded(); |
| 66 } | 66 } |
| OLD | NEW |