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

Unified Diff: net/cert/test_root_certs_mac.cc

Issue 2746103003: Add X509CertificateBytes which uses CRYPTO_BUFFER instead of macOS-native certificate types. (Closed)
Patch Set: rebase Created 3 years, 8 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 | « net/cert/internal/trust_store_mac_unittest.cc ('k') | net/cert/x509_certificate.h » ('j') | no next file with comments »
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 fcbca9729087ff78522bbe093c7c4863ac8510ee..f3a51e1f59c5779469be0fa00c01f89422e55b0d 100644
--- a/net/cert/test_root_certs_mac.cc
+++ b/net/cert/test_root_certs_mac.cc
@@ -9,14 +9,25 @@
#include "base/logging.h"
#include "net/cert/x509_certificate.h"
+#if defined(OS_IOS)
+#include "net/cert/x509_util_ios.h"
+#else
+#include "net/cert/x509_util_mac.h"
+#endif
+
namespace net {
bool TestRootCerts::Add(X509Certificate* certificate) {
+ base::ScopedCFTypeRef<SecCertificateRef> os_cert(
+ x509_util::CreateSecCertificateFromX509Certificate(certificate));
+ if (!os_cert)
+ return false;
+
if (CFArrayContainsValue(temporary_roots_,
CFRangeMake(0, CFArrayGetCount(temporary_roots_)),
- certificate->os_cert_handle()))
+ os_cert.get()))
return true;
- CFArrayAppendValue(temporary_roots_, certificate->os_cert_handle());
+ CFArrayAppendValue(temporary_roots_, os_cert.get());
return true;
}
« no previous file with comments | « net/cert/internal/trust_store_mac_unittest.cc ('k') | net/cert/x509_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698