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

Unified Diff: ios/web/web_state/wk_web_view_security_util.mm

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
Index: ios/web/web_state/wk_web_view_security_util.mm
diff --git a/ios/web/web_state/wk_web_view_security_util.mm b/ios/web/web_state/wk_web_view_security_util.mm
index 5836fab7bedb1e82103805e815a5d325ac121e43..5b7e446655eda9646d004b66b429f06330a91e8b 100644
--- a/ios/web/web_state/wk_web_view_security_util.mm
+++ b/ios/web/web_state/wk_web_view_security_util.mm
@@ -7,6 +7,7 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
#include "net/cert/x509_certificate.h"
+#include "net/cert/x509_util_ios.h"
#include "net/ssl/ssl_info.h"
namespace web {
@@ -47,11 +48,11 @@ namespace web {
scoped_refptr<net::X509Certificate> CreateCertFromChain(NSArray* certs) {
if (certs.count == 0)
return nullptr;
- net::X509Certificate::OSCertHandles intermediates;
+ std::vector<SecCertificateRef> intermediates;
for (NSUInteger i = 1; i < certs.count; i++) {
intermediates.push_back(reinterpret_cast<SecCertificateRef>(certs[i]));
}
- return net::X509Certificate::CreateFromHandle(
+ return net::x509_util::CreateX509CertificateFromSecCertificate(
reinterpret_cast<SecCertificateRef>(certs[0]), intermediates);
}
@@ -65,11 +66,11 @@ scoped_refptr<net::X509Certificate> CreateCertFromTrust(SecTrustRef trust) {
return nullptr;
}
- net::X509Certificate::OSCertHandles intermediates;
+ std::vector<SecCertificateRef> intermediates;
for (CFIndex i = 1; i < cert_count; i++) {
intermediates.push_back(SecTrustGetCertificateAtIndex(trust, i));
}
- return net::X509Certificate::CreateFromHandle(
+ return net::x509_util::CreateX509CertificateFromSecCertificate(
SecTrustGetCertificateAtIndex(trust, 0), intermediates);
}
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller_unittest.mm ('k') | ios/web/web_state/wk_web_view_security_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698