-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong default service name and account name are used when getting
keychain password. Also fix getting correct keychain password when importing from chrome, brave and chromium
- Loading branch information
Showing
3 changed files
with
54 additions
and
69 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 15 additions & 8 deletions
23
patches/components-os_crypt-keychain_password_mac.mm.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
diff --git a/components/os_crypt/keychain_password_mac.mm b/components/os_crypt/keychain_password_mac.mm | ||
index 5589310e2e1f41a6a97e77bb57a7a71cd09a18be..dcc59064077b667171e3b49d522e71a2acb76af8 100644 | ||
index 5589310e2e1f41a6a97e77bb57a7a71cd09a18be..af1be3edb2b6135bf93c5fdd42781a92a32ddb9a 100644 | ||
--- a/components/os_crypt/keychain_password_mac.mm | ||
+++ b/components/os_crypt/keychain_password_mac.mm | ||
@@ -80,6 +80,7 @@ KeychainPassword::KeychainPassword(const AppleKeychain& keychain) | ||
KeychainPassword::~KeychainPassword() = default; | ||
@@ -64,12 +64,14 @@ std::string AddRandomPasswordToKeychain(const AppleKeychain& keychain, | ||
|
||
std::string KeychainPassword::GetPassword() const { | ||
+ BRAVE_KEYCHAIN_PASSWORD_GET_PASSWORD | ||
UInt32 password_length = 0; | ||
void* password_data = nullptr; | ||
OSStatus error = keychain_.FindGenericPassword( | ||
// static | ||
KeychainPassword::KeychainNameType& KeychainPassword::GetServiceName() { | ||
+ BRAVE_GET_SERVICE_NAME | ||
static KeychainNameContainerType service_name(kDefaultServiceName); | ||
return *service_name; | ||
} | ||
|
||
// static | ||
KeychainPassword::KeychainNameType& KeychainPassword::GetAccountName() { | ||
+ BRAVE_GET_ACCOUNT_NAME | ||
static KeychainNameContainerType account_name(kDefaultAccountName); | ||
return *account_name; | ||
} |