| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "crypto/apple_keychain.h" | 5 #include "crypto/apple_keychain.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "crypto/mac_security_services_lock.h" | 10 #include "crypto/mac_security_services_lock.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 base::AutoLock lock(GetMacSecurityServicesLock()); | 48 base::AutoLock lock(GetMacSecurityServicesLock()); |
| 49 return SecKeychainItemDelete(itemRef); | 49 return SecKeychainItemDelete(itemRef); |
| 50 } | 50 } |
| 51 | 51 |
| 52 OSStatus AppleKeychain::SearchCreateFromAttributes( | 52 OSStatus AppleKeychain::SearchCreateFromAttributes( |
| 53 CFTypeRef keychainOrArray, | 53 CFTypeRef keychainOrArray, |
| 54 SecItemClass itemClass, | 54 SecItemClass itemClass, |
| 55 const SecKeychainAttributeList* attrList, | 55 const SecKeychainAttributeList* attrList, |
| 56 SecKeychainSearchRef* searchRef) const { | 56 SecKeychainSearchRef* searchRef) const { |
| 57 base::AutoLock lock(GetMacSecurityServicesLock()); | 57 base::AutoLock lock(GetMacSecurityServicesLock()); |
| 58 // Eventually, this deprecated method should be removed entirely. |
| 59 // https://crbug.com/595468 |
| 60 #pragma clang diagnostic push |
| 61 #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 58 return SecKeychainSearchCreateFromAttributes(keychainOrArray, itemClass, | 62 return SecKeychainSearchCreateFromAttributes(keychainOrArray, itemClass, |
| 59 attrList, searchRef); | 63 attrList, searchRef); |
| 64 #pragma clang diagnostic pop |
| 60 } | 65 } |
| 61 | 66 |
| 62 OSStatus AppleKeychain::SearchCopyNext(SecKeychainSearchRef searchRef, | 67 OSStatus AppleKeychain::SearchCopyNext(SecKeychainSearchRef searchRef, |
| 63 SecKeychainItemRef* itemRef) const { | 68 SecKeychainItemRef* itemRef) const { |
| 64 base::AutoLock lock(GetMacSecurityServicesLock()); | 69 base::AutoLock lock(GetMacSecurityServicesLock()); |
| 70 // Eventually, this deprecated method should be removed entirely. |
| 71 // https://crbug.com/595468 |
| 72 #pragma clang diagnostic push |
| 73 #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 65 return SecKeychainSearchCopyNext(searchRef, itemRef); | 74 return SecKeychainSearchCopyNext(searchRef, itemRef); |
| 75 #pragma clang diagnostic pop |
| 66 } | 76 } |
| 67 | 77 |
| 68 OSStatus AppleKeychain::AddInternetPassword( | 78 OSStatus AppleKeychain::AddInternetPassword( |
| 69 SecKeychainRef keychain, | 79 SecKeychainRef keychain, |
| 70 UInt32 serverNameLength, | 80 UInt32 serverNameLength, |
| 71 const char* serverName, | 81 const char* serverName, |
| 72 UInt32 securityDomainLength, | 82 UInt32 securityDomainLength, |
| 73 const char* securityDomain, | 83 const char* securityDomain, |
| 74 UInt32 accountNameLength, | 84 UInt32 accountNameLength, |
| 75 const char* accountName, | 85 const char* accountName, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 passwordData, | 145 passwordData, |
| 136 itemRef); | 146 itemRef); |
| 137 } | 147 } |
| 138 | 148 |
| 139 void AppleKeychain::Free(CFTypeRef ref) const { | 149 void AppleKeychain::Free(CFTypeRef ref) const { |
| 140 if (ref) | 150 if (ref) |
| 141 CFRelease(ref); | 151 CFRelease(ref); |
| 142 } | 152 } |
| 143 | 153 |
| 144 } // namespace crypto | 154 } // namespace crypto |
| OLD | NEW |