From 6d5733d7e21dd379bc15393156b0e80b9f3e26d0 Mon Sep 17 00:00:00 2001 From: "rsleevi@chromium.org" Date: Mon, 29 Apr 2013 20:05:58 +0000 Subject: Remove OS X 10.5 support code from net/cert Remove some unnecessary comments/look-up code, now that OS X 10.6+ is the required target. BUG=none TEST=unit tests R=wtc Review URL: https://chromiumcodereview.appspot.com/14522021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197119 0039d316-1c4b-4281-b951-d872f2087c98 --- net/cert/cert_verify_proc_mac.cc | 3 +-- net/cert/test_root_certs_mac.cc | 47 ++-------------------------------------- 2 files changed, 3 insertions(+), 47 deletions(-) (limited to 'net/cert') diff --git a/net/cert/cert_verify_proc_mac.cc b/net/cert/cert_verify_proc_mac.cc index eafb551..59f7823 100644 --- a/net/cert/cert_verify_proc_mac.cc +++ b/net/cert/cert_verify_proc_mac.cc @@ -555,8 +555,7 @@ int CertVerifyProcMac::VerifyInternal( if (flags & CertVerifier::VERIFY_EV_CERT) { // Determine the certificate's EV status using SecTrustCopyExtendedResult(), - // which we need to look up because the function wasn't added until - // Mac OS X 10.5.7. + // which is an internal/private API function added in OS X 10.5.7. // Note: "ExtendedResult" means extended validation results. CFBundleRef bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.security")); diff --git a/net/cert/test_root_certs_mac.cc b/net/cert/test_root_certs_mac.cc index 475fb24..18ae0d6 100644 --- a/net/cert/test_root_certs_mac.cc +++ b/net/cert/test_root_certs_mac.cc @@ -68,53 +68,10 @@ OSStatus TestRootCerts::FixupSecTrustRef(SecTrustRef trust_ref) const { if (IsEmpty()) return noErr; - CFBundleRef bundle = - CFBundleGetBundleWithIdentifier(CFSTR("com.apple.security")); - SecTrustSetAnchorCertificatesOnlyFuncPtr set_anchor_certificates_only = NULL; - if (bundle) { - set_anchor_certificates_only = - reinterpret_cast( - CFBundleGetFunctionPointerForName(bundle, - CFSTR("SecTrustSetAnchorCertificatesOnly"))); - } - - OSStatus status = noErr; - if (set_anchor_certificates_only) { - // OS X 10.6 includes a function where the system trusts can be - // preserved while appending application trusts. This is preferable, - // because it preserves any user trust settings (explicit distrust), - // which the naive copy in 10.5 does not. Unfortunately, though the - // function pointer may be available, it is not always implemented. If it - // returns errSecUnimplemented, fall through to the 10.5 behaviour. - status = SecTrustSetAnchorCertificates(trust_ref, temporary_roots_); - if (status) - return status; - status = set_anchor_certificates_only(trust_ref, false); - if (status != errSecUnimplemented) - return status; - - // Restore the original settings before falling back. - status = SecTrustSetAnchorCertificates(trust_ref, NULL); - if (status) - return status; - } - - // On 10.5, the system certificates have to be copied and merged into - // the application trusts, and may override any user trust settings. - CFArrayRef system_roots = NULL; - status = SecTrustCopyAnchorCertificates(&system_roots); + OSStatus status = SecTrustSetAnchorCertificates(trust_ref, temporary_roots_); if (status) return status; - - base::mac::ScopedCFTypeRef scoped_system_roots(system_roots); - base::mac::ScopedCFTypeRef scoped_roots( - CFArrayCreateMutableCopy(kCFAllocatorDefault, 0, - scoped_system_roots)); - DCHECK(scoped_roots.get()); - - CFArrayAppendArray(scoped_roots, temporary_roots_, - CFRangeMake(0, CFArrayGetCount(temporary_roots_))); - return SecTrustSetAnchorCertificates(trust_ref, scoped_roots); + return SecTrustSetAnchorCertificatesOnly(trust_ref, false); } TestRootCerts::~TestRootCerts() {} -- cgit v1.1