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

Unified Diff: net/base/x509_certificate_mac.cc

Issue 7324039: Ensure X509Certificate::OSCertHandles are safe to be used on both UI and IO threads on Win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac fix Created 9 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
Index: net/base/x509_certificate_mac.cc
diff --git a/net/base/x509_certificate_mac.cc b/net/base/x509_certificate_mac.cc
index 2c959812c596a05f3db9986fbfb1555217861107..046e64ad0c93513bda914cc68b970680bba1f9d8 100644
--- a/net/base/x509_certificate_mac.cc
+++ b/net/base/x509_certificate_mac.cc
@@ -27,6 +27,7 @@
#include "net/base/net_errors.h"
#include "net/base/test_root_certs.h"
#include "net/base/x509_certificate_known_roots_mac.h"
+#include "net/base/x509_util_mac.h"
#include "third_party/apple_apsl/cssmapplePriv.h"
#include "third_party/nss/mozilla/security/nss/lib/certdb/cert.h"
@@ -768,14 +769,8 @@ int X509Certificate::VerifyInternal(const std::string& hostname,
// array of certificates, the first of which is the certificate we're
// verifying, and the subsequent (optional) certificates are used for
// chain building.
- CFMutableArrayRef cert_array = CFArrayCreateMutable(kCFAllocatorDefault, 0,
- &kCFTypeArrayCallBacks);
- if (!cert_array)
- return ERR_OUT_OF_MEMORY;
- ScopedCFTypeRef<CFArrayRef> scoped_cert_array(cert_array);
- CFArrayAppendValue(cert_array, cert_handle_);
- for (size_t i = 0; i < intermediate_ca_certs_.size(); ++i)
- CFArrayAppendValue(cert_array, intermediate_ca_certs_[i]);
+ ScopedCFTypeRef<CFArrayRef> cert_array(
+ x509_util::CreateOSCertChainForCert(this));
// 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

Powered by Google App Engine
This is Rietveld 408576698