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

Unified Diff: net/cert/cert_verify_proc_ios_unittest.cc

Issue 2864133002: Convert iOS to use X509CertificateBytes. (Closed)
Patch Set: static_cast, more unittest Created 3 years, 7 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/cert_verify_proc_ios.cc ('k') | net/cert/cert_verify_proc_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_verify_proc_ios_unittest.cc
diff --git a/net/cert/cert_verify_proc_ios_unittest.cc b/net/cert/cert_verify_proc_ios_unittest.cc
index b2191ce64ae7c6be79e7d81854eb46fc003ac8fd..e76b2b7373cc718a6cbc3efecbc16d5c0846a45b 100644
--- a/net/cert/cert_verify_proc_ios_unittest.cc
+++ b/net/cert/cert_verify_proc_ios_unittest.cc
@@ -10,6 +10,7 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/ref_counted.h"
#include "net/cert/x509_certificate.h"
+#include "net/cert/x509_util_ios_and_mac.h"
#include "net/test/cert_test_util.h"
#include "net/test/test_data_directory.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -23,14 +24,22 @@ base::ScopedCFTypeRef<SecTrustRef> CreateSecTrust(
scoped_refptr<net::X509Certificate> cert =
net::ImportCertFromFile(net::GetTestCertsDirectory(), cert_file);
+ if (!cert) {
+ ADD_FAILURE();
+ return scoped_result;
+ }
base::ScopedCFTypeRef<CFMutableArrayRef> certs(
- CFArrayCreateMutable(kCFAllocatorDefault, 1, &kCFTypeArrayCallBacks));
- CFArrayAppendValue(certs, cert->os_cert_handle());
+ net::x509_util::CreateSecCertificateArrayForX509Certificate(cert.get()));
+ if (!certs) {
+ ADD_FAILURE();
+ return scoped_result;
+ }
base::ScopedCFTypeRef<SecPolicyRef> policy(
SecPolicyCreateSSL(TRUE, CFSTR("chromium.org")));
SecTrustRef result = nullptr;
- if (SecTrustCreateWithCertificates(certs, policy, &result) == errSecSuccess) {
+ if (SecTrustCreateWithCertificates(certs.get(), policy, &result) ==
+ errSecSuccess) {
scoped_result.reset(result);
}
return scoped_result;
« no previous file with comments | « net/cert/cert_verify_proc_ios.cc ('k') | net/cert/cert_verify_proc_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698