| Index: net/cert/test_root_certs_mac.cc
|
| diff --git a/net/cert/test_root_certs_mac.cc b/net/cert/test_root_certs_mac.cc
|
| index af1e9c18dbe3ebc91f23642bffd09877545108ed..fcbca9729087ff78522bbe093c7c4863ac8510ee 100644
|
| --- a/net/cert/test_root_certs_mac.cc
|
| +++ b/net/cert/test_root_certs_mac.cc
|
| @@ -11,41 +11,6 @@
|
|
|
| namespace net {
|
|
|
| -namespace {
|
| -
|
| -typedef OSStatus (*SecTrustSetAnchorCertificatesOnlyFuncPtr)(SecTrustRef,
|
| - Boolean);
|
| -
|
| -Boolean OurSecCertificateEqual(const void* value1, const void* value2) {
|
| - if (CFGetTypeID(value1) != SecCertificateGetTypeID() ||
|
| - CFGetTypeID(value2) != SecCertificateGetTypeID())
|
| - return CFEqual(value1, value2);
|
| - return X509Certificate::IsSameOSCert(
|
| - reinterpret_cast<SecCertificateRef>(const_cast<void*>(value1)),
|
| - reinterpret_cast<SecCertificateRef>(const_cast<void*>(value2)));
|
| -}
|
| -
|
| -const void* RetainWrapper(CFAllocatorRef unused, const void* value) {
|
| - return CFRetain(value);
|
| -}
|
| -
|
| -void ReleaseWrapper(CFAllocatorRef unused, const void* value) {
|
| - CFRelease(value);
|
| -}
|
| -
|
| -// CFEqual prior to 10.6 only performed pointer checks on SecCertificateRefs,
|
| -// rather than checking if they were the same (logical) certificate, so a
|
| -// custom structure is used for the array callbacks.
|
| -const CFArrayCallBacks kCertArrayCallbacks = {
|
| - 0, // version
|
| - RetainWrapper,
|
| - ReleaseWrapper,
|
| - CFCopyDescription,
|
| - OurSecCertificateEqual,
|
| -};
|
| -
|
| -} // namespace
|
| -
|
| bool TestRootCerts::Add(X509Certificate* certificate) {
|
| if (CFArrayContainsValue(temporary_roots_,
|
| CFRangeMake(0, CFArrayGetCount(temporary_roots_)),
|
| @@ -80,8 +45,8 @@ void TestRootCerts::SetAllowSystemTrust(bool allow_system_trust) {
|
| TestRootCerts::~TestRootCerts() {}
|
|
|
| void TestRootCerts::Init() {
|
| - temporary_roots_.reset(CFArrayCreateMutable(kCFAllocatorDefault, 0,
|
| - &kCertArrayCallbacks));
|
| + temporary_roots_.reset(
|
| + CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
|
| allow_system_trust_ = true;
|
| }
|
|
|
|
|