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

Side by Side Diff: net/cert/cert_verify_proc_mac.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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
« no previous file with comments | « net/base/network_activity_monitor.h ('k') | net/cert/cert_verify_proc_win.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/cert/cert_verify_proc_mac.h" 5 #include "net/cert/cert_verify_proc_mac.h"
6 6
7 #include <CommonCrypto/CommonDigest.h> 7 #include <CommonCrypto/CommonDigest.h>
8 #include <CoreServices/CoreServices.h> 8 #include <CoreServices/CoreServices.h>
9 #include <Security/Security.h> 9 #include <Security/Security.h>
10 10
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 CFIndex n = CFArrayGetCount(chain); 609 CFIndex n = CFArrayGetCount(chain);
610 if (n < 1) 610 if (n < 1)
611 return false; 611 return false;
612 SecCertificateRef root_ref = reinterpret_cast<SecCertificateRef>( 612 SecCertificateRef root_ref = reinterpret_cast<SecCertificateRef>(
613 const_cast<void*>(CFArrayGetValueAtIndex(chain, n - 1))); 613 const_cast<void*>(CFArrayGetValueAtIndex(chain, n - 1)));
614 SHA256HashValue hash = X509Certificate::CalculateFingerprint256(root_ref); 614 SHA256HashValue hash = X509Certificate::CalculateFingerprint256(root_ref);
615 return known_roots_.find(hash) != known_roots_.end(); 615 return known_roots_.find(hash) != known_roots_.end();
616 } 616 }
617 617
618 private: 618 private:
619 friend struct base::DefaultLazyInstanceTraits<OSXKnownRootHelper>; 619 friend struct base::LazyInstanceTraitsBase<OSXKnownRootHelper>;
620 620
621 OSXKnownRootHelper() { 621 OSXKnownRootHelper() {
622 CFArrayRef cert_array = NULL; 622 CFArrayRef cert_array = NULL;
623 OSStatus rv = SecTrustSettingsCopyCertificates( 623 OSStatus rv = SecTrustSettingsCopyCertificates(
624 kSecTrustSettingsDomainSystem, &cert_array); 624 kSecTrustSettingsDomainSystem, &cert_array);
625 if (rv != noErr) { 625 if (rv != noErr) {
626 LOG(ERROR) << "Unable to determine trusted roots; assuming all roots are " 626 LOG(ERROR) << "Unable to determine trusted roots; assuming all roots are "
627 << "trusted! Error " << rv; 627 << "trusted! Error " << rv;
628 return; 628 return;
629 } 629 }
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 // EV cert and it was covered by CRLSets or revocation checking passed. 1073 // EV cert and it was covered by CRLSets or revocation checking passed.
1074 verify_result->cert_status |= CERT_STATUS_IS_EV; 1074 verify_result->cert_status |= CERT_STATUS_IS_EV;
1075 } 1075 }
1076 1076
1077 return OK; 1077 return OK;
1078 } 1078 }
1079 1079
1080 } // namespace net 1080 } // namespace net
1081 1081
1082 #pragma clang diagnostic pop // "-Wdeprecated-declarations" 1082 #pragma clang diagnostic pop // "-Wdeprecated-declarations"
OLDNEW
« no previous file with comments | « net/base/network_activity_monitor.h ('k') | net/cert/cert_verify_proc_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698