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

Unified Diff: net/base/cert_verify_proc_mac.cc

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 | « net/base/cert_verify_proc_mac.h ('k') | net/base/x509_certificate_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_verify_proc_mac.cc
diff --git a/net/base/cert_verify_proc_mac.cc b/net/base/cert_verify_proc_mac.cc
index e47892970f034f18bc3486e0a6a92bd11b8a142b..9b6e28789b4cb43341b5bf07fec5d5c18c60b1ee 100644
--- a/net/base/cert_verify_proc_mac.cc
+++ b/net/base/cert_verify_proc_mac.cc
@@ -16,6 +16,8 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/sha1.h"
#include "base/string_piece.h"
+#include "base/synchronization/lock.h"
+#include "crypto/mac_security_services_lock.h"
#include "crypto/nss_util.h"
#include "crypto/sha2.h"
#include "net/base/asn1_util.h"
@@ -362,11 +364,9 @@ int CertVerifyProcMac::VerifyInternal(X509Certificate* cert,
// chain building.
ScopedCFTypeRef<CFArrayRef> cert_array(cert->CreateOSCertChainForCert());
- // From here on, only one thread can be active at a time. We have had a number
- // of sporadic crashes in the SecTrustEvaluate call below, way down inside
- // Apple's cert code, which we suspect are caused by a thread-safety issue.
- // So as a speculative fix allow only one thread to use SecTrust on this cert.
- base::AutoLock lock(verification_lock_);
+ // Serialize all calls that may use the Keychain, to work around various
+ // issues in OS X 10.6+ with multi-threaded access to Security.framework.
+ base::AutoLock lock(crypto::GetMacSecurityServicesLock());
SecTrustRef trust_ref = NULL;
status = SecTrustCreateWithCertificates(cert_array, trust_policies,
« no previous file with comments | « net/base/cert_verify_proc_mac.h ('k') | net/base/x509_certificate_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698