summaryrefslogtreecommitdiffstats
path: root/chrome/browser/keychain_mac.cc
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 01:51:45 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 01:51:45 +0000
commitecbf289873708bcbaa35780063570e346faafd57 (patch)
tree524953253f35fb0c095f90aaff16a6103b5e8a18 /chrome/browser/keychain_mac.cc
parentd5975c6b5d408767db7934347b7d4d137c657d30 (diff)
downloadchromium_src-ecbf289873708bcbaa35780063570e346faafd57.zip
chromium_src-ecbf289873708bcbaa35780063570e346faafd57.tar.gz
chromium_src-ecbf289873708bcbaa35780063570e346faafd57.tar.bz2
AutoFill credit cards should be encrypted on the Mac
These changes add encryption support on Mac for the Encryptor class. AES 128 bit is used for the encryption, and the auto-generated password is stored now in the Mac Keychain. This implies the Encryptor class on Mac can now block for user input, and can fail if access is denied. BUG=42038, 49131 TEST=EncryptorTest.CypherTextDiffers, EncryptorTest.DecryptError, EncryptorPasswordTest.* Review URL: http://codereview.chromium.org/2943014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/keychain_mac.cc')
-rw-r--r--chrome/browser/keychain_mac.cc41
1 files changed, 41 insertions, 0 deletions
diff --git a/chrome/browser/keychain_mac.cc b/chrome/browser/keychain_mac.cc
index 90d95a7..5640e6b 100644
--- a/chrome/browser/keychain_mac.cc
+++ b/chrome/browser/keychain_mac.cc
@@ -61,6 +61,47 @@ OSStatus MacKeychain::AddInternetPassword(
itemRef);
}
+OSStatus MacKeychain::FindGenericPassword(CFTypeRef keychainOrArray,
+ UInt32 serviceNameLength,
+ const char *serviceName,
+ UInt32 accountNameLength,
+ const char *accountName,
+ UInt32 *passwordLength,
+ void **passwordData,
+ SecKeychainItemRef *itemRef) const {
+ return SecKeychainFindGenericPassword(keychainOrArray,
+ serviceNameLength,
+ serviceName,
+ accountNameLength,
+ accountName,
+ passwordLength,
+ passwordData,
+ itemRef);
+}
+
+OSStatus MacKeychain::ItemFreeContent(SecKeychainAttributeList *attrList,
+ void *data) const {
+ return SecKeychainItemFreeContent(attrList, data);
+}
+
+OSStatus MacKeychain::AddGenericPassword(SecKeychainRef keychain,
+ UInt32 serviceNameLength,
+ const char *serviceName,
+ UInt32 accountNameLength,
+ const char *accountName,
+ UInt32 passwordLength,
+ const void *passwordData,
+ SecKeychainItemRef *itemRef) const {
+ return SecKeychainAddGenericPassword(keychain,
+ serviceNameLength,
+ serviceName,
+ accountNameLength,
+ accountName,
+ passwordLength,
+ passwordData,
+ itemRef);
+}
+
void MacKeychain::Free(CFTypeRef ref) const {
if (ref) {
CFRelease(ref);