diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-23 16:36:20 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-23 16:36:20 +0000 |
commit | 06139a231bd4d3216fa296a8957a72038149ca83 (patch) | |
tree | c5d7539f271b53bddbd92c3902d95aa514d5873e /chrome/browser/keychain_mac.cc | |
parent | 97c8e0369a422f0eb7f8c71418247cf75e68cd38 (diff) | |
download | chromium_src-06139a231bd4d3216fa296a8957a72038149ca83.zip chromium_src-06139a231bd4d3216fa296a8957a72038149ca83.tar.gz chromium_src-06139a231bd4d3216fa296a8957a72038149ca83.tar.bz2 |
Implement the add/update functionality for Keychain that PasswordStoreMac will
need, and modify MockKeychain slightly to allow unit testing it.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/146002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/keychain_mac.cc')
-rw-r--r-- | chrome/browser/keychain_mac.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/keychain_mac.cc b/chrome/browser/keychain_mac.cc index cf2adbd..cbd7086 100644 --- a/chrome/browser/keychain_mac.cc +++ b/chrome/browser/keychain_mac.cc @@ -12,6 +12,13 @@ OSStatus MacKeychain::ItemCopyAttributesAndData( attrList, length, outData); } +OSStatus MacKeychain::ItemModifyAttributesAndData( + SecKeychainItemRef itemRef, const SecKeychainAttributeList *attrList, + UInt32 length, const void *data) const { + return SecKeychainItemModifyAttributesAndData(itemRef, attrList, length, + data); +} + OSStatus MacKeychain::ItemFreeAttributesAndData( SecKeychainAttributeList *attrList, void *data) const { return SecKeychainItemFreeAttributesAndData(attrList, data); @@ -30,6 +37,26 @@ OSStatus MacKeychain::SearchCopyNext(SecKeychainSearchRef searchRef, return SecKeychainSearchCopyNext(searchRef, itemRef); } +OSStatus MacKeychain::AddInternetPassword( + SecKeychainRef keychain, + UInt32 serverNameLength, const char *serverName, + UInt32 securityDomainLength, const char *securityDomain, + UInt32 accountNameLength, const char *accountName, + UInt32 pathLength, const char *path, + UInt16 port, SecProtocolType protocol, + SecAuthenticationType authenticationType, + UInt32 passwordLength, const void *passwordData, + SecKeychainItemRef *itemRef) const { + return SecKeychainAddInternetPassword(keychain, + serverNameLength, serverName, + securityDomainLength, securityDomain, + accountNameLength, accountName, + pathLength, path, + port, protocol, authenticationType, + passwordLength, passwordData, + itemRef); +} + void MacKeychain::Free(CFTypeRef ref) const { if (ref) { CFRelease(ref); |