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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/base/x509_util_mac.h"
6
7 #include "net/base/x509_certificate.h"
8
9 namespace net {
10
11 namespace x509_util {
12
13 CFArrayRef CreateOSCertChainForCert(const X509Certificate* cert) {
14 CFMutableArrayRef cert_list =
15 CFArrayCreateMutable(kCFAllocatorDefault, 0,
16 &kCFTypeArrayCallBacks);
17 if (!cert_list)
18 return NULL;
19
20 CFArrayAppendValue(cert_list, cert->os_cert_handle());
21 const X509Certificate::OSCertHandles& intermediates =
22 cert->GetIntermediateCertificates();
23 for (size_t i = 0; i < intermediates.size(); ++i)
24 CFArrayAppendValue(cert_list, intermediates[i]);
25
26 return cert_list;
27 }
28
29 } // namespace x509_util
30
31 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698