Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: crypto/apple_keychain_mac.mm

Issue 11016004: Force crypto::AppleKeychain access to be guarded by a Big Global Lock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment update Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/cert_verify_proc_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/apple_keychain_mac.mm
diff --git a/crypto/apple_keychain_mac.mm b/crypto/apple_keychain_mac.mm
index 545be1957f741df2e3b52e71d01faac5a25879bb..240c32067bcf147858e21746affbe2883cd3d171 100644
--- a/crypto/apple_keychain_mac.mm
+++ b/crypto/apple_keychain_mac.mm
@@ -6,6 +6,9 @@
#import <Foundation/Foundation.h>
+#include "base/synchronization/lock.h"
+#include "crypto/mac_security_services_lock.h"
+
namespace crypto {
AppleKeychain::AppleKeychain() {}
@@ -19,6 +22,7 @@ OSStatus AppleKeychain::ItemCopyAttributesAndData(
SecKeychainAttributeList** attrList,
UInt32* length,
void** outData) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainItemCopyAttributesAndData(itemRef, info, itemClass,
attrList, length, outData);
}
@@ -28,6 +32,7 @@ OSStatus AppleKeychain::ItemModifyAttributesAndData(
const SecKeychainAttributeList* attrList,
UInt32 length,
const void* data) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainItemModifyAttributesAndData(itemRef, attrList, length,
data);
}
@@ -35,10 +40,12 @@ OSStatus AppleKeychain::ItemModifyAttributesAndData(
OSStatus AppleKeychain::ItemFreeAttributesAndData(
SecKeychainAttributeList* attrList,
void* data) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainItemFreeAttributesAndData(attrList, data);
}
OSStatus AppleKeychain::ItemDelete(SecKeychainItemRef itemRef) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainItemDelete(itemRef);
}
@@ -47,12 +54,14 @@ OSStatus AppleKeychain::SearchCreateFromAttributes(
SecItemClass itemClass,
const SecKeychainAttributeList* attrList,
SecKeychainSearchRef* searchRef) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainSearchCreateFromAttributes(keychainOrArray, itemClass,
attrList, searchRef);
}
OSStatus AppleKeychain::SearchCopyNext(SecKeychainSearchRef searchRef,
SecKeychainItemRef* itemRef) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainSearchCopyNext(searchRef, itemRef);
}
@@ -72,6 +81,7 @@ OSStatus AppleKeychain::AddInternetPassword(
UInt32 passwordLength,
const void* passwordData,
SecKeychainItemRef* itemRef) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainAddInternetPassword(keychain,
serverNameLength, serverName,
securityDomainLength, securityDomain,
@@ -90,6 +100,7 @@ OSStatus AppleKeychain::FindGenericPassword(CFTypeRef keychainOrArray,
UInt32* passwordLength,
void** passwordData,
SecKeychainItemRef* itemRef) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainFindGenericPassword(keychainOrArray,
serviceNameLength,
serviceName,
@@ -102,6 +113,7 @@ OSStatus AppleKeychain::FindGenericPassword(CFTypeRef keychainOrArray,
OSStatus AppleKeychain::ItemFreeContent(SecKeychainAttributeList* attrList,
void* data) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainItemFreeContent(attrList, data);
}
@@ -113,6 +125,7 @@ OSStatus AppleKeychain::AddGenericPassword(SecKeychainRef keychain,
UInt32 passwordLength,
const void* passwordData,
SecKeychainItemRef* itemRef) const {
+ base::AutoLock lock(GetMacSecurityServicesLock());
return SecKeychainAddGenericPassword(keychain,
serviceNameLength,
serviceName,
« no previous file with comments | « no previous file | net/base/cert_verify_proc_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698