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

Unified Diff: components/os_crypt/keychain_password_mac.mm

Issue 2721333005: Reauthorize Keychain to Replace Developer ID Certificate (Closed)
Patch Set: Remove histogram.h include Created 3 years, 10 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
« no previous file with comments | « components/os_crypt/keychain_password_mac.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/os_crypt/keychain_password_mac.mm
diff --git a/components/os_crypt/keychain_password_mac.mm b/components/os_crypt/keychain_password_mac.mm
index 1f60b9f0572ae9c61cf1d257c1457bb5b42838a4..2b38db266f9aa1f4141c8649c021042ede4e5589 100644
--- a/components/os_crypt/keychain_password_mac.mm
+++ b/components/os_crypt/keychain_password_mac.mm
@@ -47,28 +47,23 @@ std::string AddRandomPasswordToKeychain(const AppleKeychain& keychain,
} // namespace
-std::string KeychainPassword::GetPassword() const {
- // These two strings ARE indeed user facing. But they are used to access
- // the encryption keyword. So as to not lose encrypted data when system
- // locale changes we DO NOT LOCALIZE.
+// These two strings ARE indeed user facing. But they are used to access
+// the encryption keyword. So as to not lose encrypted data when system
+// locale changes we DO NOT LOCALIZE.
#if defined(GOOGLE_CHROME_BUILD)
- const std::string service_name = "Chrome Safe Storage";
- const std::string account_name = "Chrome";
+const char KeychainPassword::service_name[] = "Chrome Safe Storage";
+const char KeychainPassword::account_name[] = "Chrome";
#else
- const std::string service_name = "Chromium Safe Storage";
- const std::string account_name = "Chromium";
+const char KeychainPassword::service_name[] = "Chromium Safe Storage";
+const char KeychainPassword::account_name[] = "Chromium";
#endif
+std::string KeychainPassword::GetPassword() const {
UInt32 password_length = 0;
void* password_data = NULL;
- OSStatus error = keychain_.FindGenericPassword(NULL,
- service_name.size(),
- service_name.data(),
- account_name.size(),
- account_name.data(),
- &password_length,
- &password_data,
- NULL);
+ OSStatus error = keychain_.FindGenericPassword(
+ nullptr, strlen(service_name), service_name, strlen(account_name),
+ account_name, &password_length, &password_data, NULL);
if (error == noErr) {
std::string password =
« no previous file with comments | « components/os_crypt/keychain_password_mac.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698