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

Unified Diff: net/cert/test_root_certs_mac.cc

Issue 2756733003: Delete SecCertificate equality hacks for old macOS versions (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/cert/x509_certificate_mac.cc » ('j') | net/cert/x509_certificate_mac.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | net/cert/x509_certificate_mac.cc » ('j') | net/cert/x509_certificate_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698