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

Unified Diff: net/cert/x509_certificate_ios.cc

Issue 2824713002: Trim some dependencies on crypto/x509 headers. (Closed)
Patch Set: . 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/verify_signed_data_unittest.cc ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate_ios.cc
diff --git a/net/cert/x509_certificate_ios.cc b/net/cert/x509_certificate_ios.cc
index 0c3f162b2053048a044db9b1a5766379f5e245f1..df8482f1ba2a09efd6e13555f5a30a1589be8a3b 100644
--- a/net/cert/x509_certificate_ios.cc
+++ b/net/cert/x509_certificate_ios.cc
@@ -39,6 +39,15 @@ bool IsValidOSCertHandle(SecCertificateRef cert_handle) {
return sanity_check != nullptr;
}
+bssl::UniquePtr<X509> OSCertHandleToOpenSSL(
+ X509Certificate::OSCertHandle os_handle) {
+ std::string der_encoded;
+ if (!X509Certificate::GetDEREncoded(os_handle, &der_encoded))
+ return nullptr;
+ const uint8_t* bytes = reinterpret_cast<const uint8_t*>(der_encoded.data());
+ return bssl::UniquePtr<X509>(d2i_X509(nullptr, &bytes, der_encoded.size()));
+}
+
void CreateOSCertHandlesFromPKCS7Bytes(
const char* data,
size_t length,
« no previous file with comments | « net/cert/internal/verify_signed_data_unittest.cc ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698