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

Side by Side Diff: net/base/x509_certificate_mac.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 years, 1 month 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
« no previous file with comments | « net/base/mock_host_resolver.cc ('k') | net/base/x509_certificate_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/x509_certificate.h" 5 #include "net/base/x509_certificate.h"
6 6
7 #include <CommonCrypto/CommonDigest.h> 7 #include <CommonCrypto/CommonDigest.h>
8 #include <Security/Security.h> 8 #include <Security/Security.h>
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 result = CopyCertChain(os_cert_handle(), &cert_chain); 865 result = CopyCertChain(os_cert_handle(), &cert_chain);
866 if (result != noErr) 866 if (result != noErr)
867 return false; 867 return false;
868 ScopedCFTypeRef<CFArrayRef> scoped_cert_chain(cert_chain); 868 ScopedCFTypeRef<CFArrayRef> scoped_cert_chain(cert_chain);
869 869
870 // Check all the certs in the chain for a match. 870 // Check all the certs in the chain for a match.
871 int n = CFArrayGetCount(cert_chain); 871 int n = CFArrayGetCount(cert_chain);
872 for (int i = 0; i < n; ++i) { 872 for (int i = 0; i < n; ++i) {
873 SecCertificateRef cert_handle = reinterpret_cast<SecCertificateRef>( 873 SecCertificateRef cert_handle = reinterpret_cast<SecCertificateRef>(
874 const_cast<void*>(CFArrayGetValueAtIndex(cert_chain, i))); 874 const_cast<void*>(CFArrayGetValueAtIndex(cert_chain, i)));
875 scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle( 875 scoped_refptr<X509Certificate> cert(X509Certificate::CreateFromHandle(
876 cert_handle, 876 cert_handle,
877 X509Certificate::SOURCE_LONE_CERT_IMPORT, 877 X509Certificate::SOURCE_LONE_CERT_IMPORT,
878 X509Certificate::OSCertHandles()); 878 X509Certificate::OSCertHandles()));
879 for (unsigned j = 0; j < valid_issuers.size(); j++) { 879 for (unsigned j = 0; j < valid_issuers.size(); j++) {
880 if (cert->issuer().Matches(valid_issuers[j])) 880 if (cert->issuer().Matches(valid_issuers[j]))
881 return true; 881 return true;
882 } 882 }
883 } 883 }
884 return false; 884 return false;
885 } 885 }
886 886
887 // static 887 // static
888 OSStatus X509Certificate::CreateSSLClientPolicy(SecPolicyRef* out_policy) { 888 OSStatus X509Certificate::CreateSSLClientPolicy(SecPolicyRef* out_policy) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 } 1003 }
1004 CFRelease(cert_chain); 1004 CFRelease(cert_chain);
1005 } 1005 }
1006 exit: 1006 exit:
1007 if (result) 1007 if (result)
1008 LOG(ERROR) << "CreateIdentityCertificateChain error " << result; 1008 LOG(ERROR) << "CreateIdentityCertificateChain error " << result;
1009 return chain.release(); 1009 return chain.release();
1010 } 1010 }
1011 1011
1012 } // namespace net 1012 } // namespace net
OLDNEW
« no previous file with comments | « net/base/mock_host_resolver.cc ('k') | net/base/x509_certificate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698