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

Unified Diff: net/base/x509_util_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_util_mac.cc
diff --git a/net/base/x509_util_mac.cc b/net/base/x509_util_mac.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c381e0869c53fca86afff4ce99fb5c828480e0ee
--- /dev/null
+++ b/net/base/x509_util_mac.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/x509_util_mac.h"
+
+#include "net/base/x509_certificate.h"
+
+namespace net {
+
+namespace x509_util {
+
+CFArrayRef CreateOSCertChainForCert(const X509Certificate* cert) {
+ CFMutableArrayRef cert_list =
+ CFArrayCreateMutable(kCFAllocatorDefault, 0,
+ &kCFTypeArrayCallBacks);
+ if (!cert_list)
+ return NULL;
+
+ CFArrayAppendValue(cert_list, cert->os_cert_handle());
+ const X509Certificate::OSCertHandles& intermediates =
+ cert->GetIntermediateCertificates();
+ for (size_t i = 0; i < intermediates.size(); ++i)
+ CFArrayAppendValue(cert_list, intermediates[i]);
+
+ return cert_list;
+}
+
+} // namespace x509_util
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698