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

Unified Diff: components/os_crypt/libsecret_util_linux.cc

Issue 1973483002: OSCrypt for POSIX uses libsecret to store a randomised encryption key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed lsan failure Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/os_crypt/libsecret_util_linux.cc
diff --git a/components/os_crypt/libsecret_util_posix.cc b/components/os_crypt/libsecret_util_linux.cc
similarity index 93%
rename from components/os_crypt/libsecret_util_posix.cc
rename to components/os_crypt/libsecret_util_linux.cc
index 58ba9d0518aa4495a097fe4cba51de127d5a09ff..e6239965d226acf19f502df59a64b3f77ced72b3 100644
--- a/components/os_crypt/libsecret_util_posix.cc
+++ b/components/os_crypt/libsecret_util_linux.cc
@@ -2,13 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/os_crypt/libsecret_util_posix.h"
+#include "components/os_crypt/libsecret_util_linux.h"
#include <dlfcn.h>
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
+//
+// LibsecretLoader
+//
+
decltype(
&::secret_password_store_sync) LibsecretLoader::secret_password_store_sync;
decltype(
@@ -22,24 +26,29 @@ decltype(
decltype(&::secret_item_load_secret_sync)
LibsecretLoader::secret_item_load_secret_sync;
decltype(&::secret_value_unref) LibsecretLoader::secret_value_unref;
+decltype(
+ &::secret_service_lookup_sync) LibsecretLoader::secret_service_lookup_sync;
bool LibsecretLoader::libsecret_loaded_ = false;
const LibsecretLoader::FunctionInfo LibsecretLoader::kFunctions[] = {
- {"secret_password_store_sync",
- reinterpret_cast<void**>(&secret_password_store_sync)},
- {"secret_service_search_sync",
- reinterpret_cast<void**>(&secret_service_search_sync)},
- {"secret_password_clear_sync",
- reinterpret_cast<void**>(&secret_password_clear_sync)},
{"secret_item_get_secret",
reinterpret_cast<void**>(&secret_item_get_secret)},
- {"secret_value_get_text", reinterpret_cast<void**>(&secret_value_get_text)},
{"secret_item_get_attributes",
reinterpret_cast<void**>(&secret_item_get_attributes)},
{"secret_item_load_secret_sync",
reinterpret_cast<void**>(&secret_item_load_secret_sync)},
- {"secret_value_unref", reinterpret_cast<void**>(&secret_value_unref)}};
+ {"secret_password_clear_sync",
+ reinterpret_cast<void**>(&secret_password_clear_sync)},
+ {"secret_password_store_sync",
+ reinterpret_cast<void**>(&secret_password_store_sync)},
+ {"secret_service_lookup_sync",
+ reinterpret_cast<void**>(&secret_service_lookup_sync)},
+ {"secret_service_search_sync",
+ reinterpret_cast<void**>(&secret_service_search_sync)},
+ {"secret_value_get_text", reinterpret_cast<void**>(&secret_value_get_text)},
+ {"secret_value_unref", reinterpret_cast<void**>(&secret_value_unref)},
+};
// static
bool LibsecretLoader::EnsureLibsecretLoaded() {
@@ -107,6 +116,10 @@ bool LibsecretLoader::LibsecretIsAvailable() {
return success;
}
+//
+// LibsecretAttributesBuilder
+//
+
LibsecretAttributesBuilder::LibsecretAttributesBuilder() {
attrs_ = g_hash_table_new_full(g_str_hash, g_str_equal,
nullptr, // no deleter for keys

Powered by Google App Engine
This is Rietveld 408576698