OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "crypto/keychain_mac.h" | |
6 | |
7 namespace crypto { | |
8 | |
9 MacKeychain::MacKeychain() {} | |
10 | |
11 MacKeychain::~MacKeychain() {} | |
12 | |
13 OSStatus MacKeychain::ItemCopyAttributesAndData( | |
14 SecKeychainItemRef itemRef, | |
15 SecKeychainAttributeInfo* info, | |
16 SecItemClass* itemClass, | |
17 SecKeychainAttributeList** attrList, | |
18 UInt32* length, | |
19 void** outData) const { | |
20 return SecKeychainItemCopyAttributesAndData(itemRef, info, itemClass, | |
21 attrList, length, outData); | |
22 } | |
23 | |
24 OSStatus MacKeychain::ItemModifyAttributesAndData( | |
25 SecKeychainItemRef itemRef, | |
26 const SecKeychainAttributeList* attrList, | |
27 UInt32 length, | |
28 const void* data) const { | |
29 return SecKeychainItemModifyAttributesAndData(itemRef, attrList, length, | |
30 data); | |
31 } | |
32 | |
33 OSStatus MacKeychain::ItemFreeAttributesAndData( | |
34 SecKeychainAttributeList* attrList, | |
35 void* data) const { | |
36 return SecKeychainItemFreeAttributesAndData(attrList, data); | |
37 } | |
38 | |
39 OSStatus MacKeychain::ItemDelete(SecKeychainItemRef itemRef) const { | |
40 return SecKeychainItemDelete(itemRef); | |
41 } | |
42 | |
43 OSStatus MacKeychain::SearchCreateFromAttributes( | |
44 CFTypeRef keychainOrArray, | |
45 SecItemClass itemClass, | |
46 const SecKeychainAttributeList* attrList, | |
47 SecKeychainSearchRef* searchRef) const { | |
48 return SecKeychainSearchCreateFromAttributes(keychainOrArray, itemClass, | |
49 attrList, searchRef); | |
50 } | |
51 | |
52 OSStatus MacKeychain::SearchCopyNext(SecKeychainSearchRef searchRef, | |
53 SecKeychainItemRef* itemRef) const { | |
54 return SecKeychainSearchCopyNext(searchRef, itemRef); | |
55 } | |
56 | |
57 OSStatus MacKeychain::AddInternetPassword( | |
58 SecKeychainRef keychain, | |
59 UInt32 serverNameLength, | |
60 const char* serverName, | |
61 UInt32 securityDomainLength, | |
62 const char* securityDomain, | |
63 UInt32 accountNameLength, | |
64 const char* accountName, | |
65 UInt32 pathLength, | |
66 const char* path, | |
67 UInt16 port, | |
68 SecProtocolType protocol, | |
69 SecAuthenticationType authenticationType, | |
70 UInt32 passwordLength, | |
71 const void* passwordData, | |
72 SecKeychainItemRef* itemRef) const { | |
73 return SecKeychainAddInternetPassword(keychain, | |
74 serverNameLength, serverName, | |
75 securityDomainLength, securityDomain, | |
76 accountNameLength, accountName, | |
77 pathLength, path, | |
78 port, protocol, authenticationType, | |
79 passwordLength, passwordData, | |
80 itemRef); | |
81 } | |
82 | |
83 OSStatus MacKeychain::FindGenericPassword(CFTypeRef keychainOrArray, | |
84 UInt32 serviceNameLength, | |
85 const char* serviceName, | |
86 UInt32 accountNameLength, | |
87 const char* accountName, | |
88 UInt32* passwordLength, | |
89 void** passwordData, | |
90 SecKeychainItemRef* itemRef) const { | |
91 return SecKeychainFindGenericPassword(keychainOrArray, | |
92 serviceNameLength, | |
93 serviceName, | |
94 accountNameLength, | |
95 accountName, | |
96 passwordLength, | |
97 passwordData, | |
98 itemRef); | |
99 } | |
100 | |
101 OSStatus MacKeychain::ItemFreeContent(SecKeychainAttributeList* attrList, | |
102 void* data) const { | |
103 return SecKeychainItemFreeContent(attrList, data); | |
104 } | |
105 | |
106 OSStatus MacKeychain::AddGenericPassword(SecKeychainRef keychain, | |
107 UInt32 serviceNameLength, | |
108 const char* serviceName, | |
109 UInt32 accountNameLength, | |
110 const char* accountName, | |
111 UInt32 passwordLength, | |
112 const void* passwordData, | |
113 SecKeychainItemRef* itemRef) const { | |
114 return SecKeychainAddGenericPassword(keychain, | |
115 serviceNameLength, | |
116 serviceName, | |
117 accountNameLength, | |
118 accountName, | |
119 passwordLength, | |
120 passwordData, | |
121 itemRef); | |
122 } | |
123 | |
124 void MacKeychain::Free(CFTypeRef ref) const { | |
125 if (ref) | |
126 CFRelease(ref); | |
127 } | |
128 | |
129 } // namespace crypto | |
OLD | NEW |