| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/test_root_certs.h" | 5 #include "net/base/test_root_certs.h" |
| 6 | 6 |
| 7 #include <Security/Security.h> | 7 #include <Security/Security.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
| 11 #include "net/base/x509_certificate.h" | 11 #include "net/base/x509_certificate.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 #if !defined(MAC_OS_X_VERSION_10_6) || \ | |
| 18 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 | |
| 19 // Declared in <Security/SecBase.h> of the 10.6 SDK. | |
| 20 enum { | |
| 21 errSecUnimplemented = -4, | |
| 22 }; | |
| 23 #endif | |
| 24 | |
| 25 typedef OSStatus (*SecTrustSetAnchorCertificatesOnlyFuncPtr)(SecTrustRef, | 17 typedef OSStatus (*SecTrustSetAnchorCertificatesOnlyFuncPtr)(SecTrustRef, |
| 26 Boolean); | 18 Boolean); |
| 27 | 19 |
| 28 Boolean OurSecCertificateEqual(const void* value1, const void* value2) { | 20 Boolean OurSecCertificateEqual(const void* value1, const void* value2) { |
| 29 if (CFGetTypeID(value1) != SecCertificateGetTypeID() || | 21 if (CFGetTypeID(value1) != SecCertificateGetTypeID() || |
| 30 CFGetTypeID(value2) != SecCertificateGetTypeID()) | 22 CFGetTypeID(value2) != SecCertificateGetTypeID()) |
| 31 return CFEqual(value1, value2); | 23 return CFEqual(value1, value2); |
| 32 return X509Certificate::IsSameOSCert( | 24 return X509Certificate::IsSameOSCert( |
| 33 reinterpret_cast<SecCertificateRef>(const_cast<void*>(value1)), | 25 reinterpret_cast<SecCertificateRef>(const_cast<void*>(value1)), |
| 34 reinterpret_cast<SecCertificateRef>(const_cast<void*>(value2))); | 26 reinterpret_cast<SecCertificateRef>(const_cast<void*>(value2))); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 118 } |
| 127 | 119 |
| 128 TestRootCerts::~TestRootCerts() {} | 120 TestRootCerts::~TestRootCerts() {} |
| 129 | 121 |
| 130 void TestRootCerts::Init() { | 122 void TestRootCerts::Init() { |
| 131 temporary_roots_.reset(CFArrayCreateMutable(kCFAllocatorDefault, 0, | 123 temporary_roots_.reset(CFArrayCreateMutable(kCFAllocatorDefault, 0, |
| 132 &kCertArrayCallbacks)); | 124 &kCertArrayCallbacks)); |
| 133 } | 125 } |
| 134 | 126 |
| 135 } // namespace net | 127 } // namespace net |
| OLD | NEW |