summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authordavidben <davidben@chromium.org>2016-03-21 09:05:14 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-21 16:06:40 +0000
commit5967f8d43f88fb983e7d6e46fac84ae66677b3b5 (patch)
tree1daa7c557e30e2593b4fe3424b4df7d31264b703 /net
parente3ab046fcbe969bd1b38a0361f7d583998365c2c (diff)
downloadchromium_src-5967f8d43f88fb983e7d6e46fac84ae66677b3b5.zip
chromium_src-5967f8d43f88fb983e7d6e46fac84ae66677b3b5.tar.gz
chromium_src-5967f8d43f88fb983e7d6e46fac84ae66677b3b5.tar.bz2
Remove pre-10.9 code in //net.
See https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/JVSgSL8wPnE BUG=none Review URL: https://codereview.chromium.org/1812413002 Cr-Commit-Position: refs/heads/master@{#382302}
Diffstat (limited to 'net')
-rw-r--r--net/cert/test_root_certs_mac.cc33
1 files changed, 2 insertions, 31 deletions
diff --git a/net/cert/test_root_certs_mac.cc b/net/cert/test_root_certs_mac.cc
index 87824d4c..af1e9c1 100644
--- a/net/cert/test_root_certs_mac.cc
+++ b/net/cert/test_root_certs_mac.cc
@@ -7,8 +7,6 @@
#include <Security/Security.h>
#include "base/logging.h"
-#include "base/mac/mac_util.h"
-#include "base/mac/scoped_cftyperef.h"
#include "net/cert/x509_certificate.h"
namespace net {
@@ -69,37 +67,10 @@ OSStatus TestRootCerts::FixupSecTrustRef(SecTrustRef trust_ref) const {
if (IsEmpty())
return noErr;
- // Despite SecTrustSetAnchorCertificatesOnly existing in OS X 10.6, and
- // being documented as available, it is not actually implemented. On 10.7+,
- // however, it always works.
- if (base::mac::IsOSLionOrLater()) {
- OSStatus status = SecTrustSetAnchorCertificates(trust_ref,
- temporary_roots_);
- if (status)
- return status;
- return SecTrustSetAnchorCertificatesOnly(trust_ref, !allow_system_trust_);
- }
-
- if (!allow_system_trust_) {
- // Avoid any copying if system roots are not to be trusted. This acts as
- // an exclusive list on 10.6, replacing the built-ins.
- return SecTrustSetAnchorCertificates(trust_ref, temporary_roots_);
- }
-
- // Otherwise, both system trust and temporary_roots_ must be trusted.
- // Emulate the functionality of SecTrustSetAnchorCertificatesOnly by
- // creating a copy of the system roots and merging with temporary_roots_.
- CFArrayRef system_roots = NULL;
- OSStatus status = SecTrustCopyAnchorCertificates(&system_roots);
+ OSStatus status = SecTrustSetAnchorCertificates(trust_ref, temporary_roots_);
if (status)
return status;
-
- base::ScopedCFTypeRef<CFArrayRef> scoped_system_roots(system_roots);
- base::ScopedCFTypeRef<CFMutableArrayRef> scoped_roots(
- CFArrayCreateMutableCopy(kCFAllocatorDefault, 0, scoped_system_roots));
- CFArrayAppendArray(scoped_roots, temporary_roots_,
- CFRangeMake(0, CFArrayGetCount(temporary_roots_)));
- return SecTrustSetAnchorCertificates(trust_ref, scoped_roots);
+ return SecTrustSetAnchorCertificatesOnly(trust_ref, !allow_system_trust_);
}
void TestRootCerts::SetAllowSystemTrust(bool allow_system_trust) {