Index: net/cert/cert_verify_proc_ios.cc |
diff --git a/net/cert/cert_verify_proc_ios.cc b/net/cert/cert_verify_proc_ios.cc |
index 527326e6bb86bc18c57d18da3ae9dfae84038978..ebb296014086632190a7868740c2f5dcd18b98d2 100644 |
--- a/net/cert/cert_verify_proc_ios.cc |
+++ b/net/cert/cert_verify_proc_ios.cc |
@@ -14,6 +14,8 @@ |
#include "net/cert/cert_verify_result.h" |
#include "net/cert/test_root_certs.h" |
#include "net/cert/x509_certificate.h" |
+#include "net/cert/x509_util_ios.h" |
+#include "net/cert/x509_util_ios_and_mac.h" |
#include "net/ssl/openssl_ssl_util.h" |
using base::ScopedCFTypeRef; |
@@ -115,14 +117,19 @@ void GetCertChainInfo(CFArrayRef cert_chain, CertVerifyResult* verify_result) { |
verified_chain.push_back(chain_cert); |
} |
- std::string der_bytes; |
- if (!X509Certificate::GetDEREncoded(chain_cert, &der_bytes)) { |
+ base::ScopedCFTypeRef<CFDataRef> der_data( |
+ SecCertificateCopyData(chain_cert)); |
+ if (!der_data) { |
verify_result->cert_status |= CERT_STATUS_INVALID; |
return; |
} |
base::StringPiece spki_bytes; |
- if (!asn1::ExtractSPKIFromDERCert(der_bytes, &spki_bytes)) { |
+ if (!asn1::ExtractSPKIFromDERCert( |
+ base::StringPiece( |
+ reinterpret_cast<const char*>(CFDataGetBytePtr(der_data)), |
+ CFDataGetLength(der_data)), |
+ &spki_bytes)) { |
verify_result->cert_status |= CERT_STATUS_INVALID; |
return; |
} |
@@ -148,7 +155,8 @@ void GetCertChainInfo(CFArrayRef cert_chain, CertVerifyResult* verify_result) { |
} |
scoped_refptr<X509Certificate> verified_cert_with_chain = |
- X509Certificate::CreateFromHandle(verified_cert, verified_chain); |
+ x509_util::CreateX509CertificateFromSecCertificate(verified_cert, |
+ verified_chain); |
if (verified_cert_with_chain) |
verify_result->verified_cert = std::move(verified_cert_with_chain); |
else |
@@ -248,7 +256,7 @@ int CertVerifyProcIOS::VerifyInternal( |
return NetErrorFromOSStatus(status); |
ScopedCFTypeRef<CFMutableArrayRef> cert_array( |
- cert->CreateOSCertChainForCert()); |
+ x509_util::CreateSecCertificateArrayForX509Certificate(cert)); |
ScopedCFTypeRef<SecTrustRef> trust_ref; |
SecTrustResultType trust_result = kSecTrustResultDeny; |
ScopedCFTypeRef<CFArrayRef> final_chain; |