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

Unified Diff: net/ssl/openssl_ssl_util.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/ssl/openssl_ssl_util.h ('k') | net/ssl/ssl_client_session_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/openssl_ssl_util.cc
diff --git a/net/ssl/openssl_ssl_util.cc b/net/ssl/openssl_ssl_util.cc
index c3988b4648733ed26a9527d6dcff36a410f98e6f..21b2b5656456c281ed59991148bbd8ae4db2caea 100644
--- a/net/ssl/openssl_ssl_util.cc
+++ b/net/ssl/openssl_ssl_util.cc
@@ -17,7 +17,6 @@
#include "net/ssl/ssl_connection_status_flags.h"
#include "third_party/boringssl/src/include/openssl/err.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
-#include "third_party/boringssl/src/include/openssl/x509.h"
namespace net {
@@ -225,29 +224,4 @@ int GetNetSSLVersion(SSL* ssl) {
}
}
-bssl::UniquePtr<X509> OSCertHandleToOpenSSL(
- X509Certificate::OSCertHandle os_handle) {
-#if defined(USE_OPENSSL_CERTS)
- return bssl::UniquePtr<X509>(X509Certificate::DupOSCertHandle(os_handle));
-#else // !defined(USE_OPENSSL_CERTS)
- std::string der_encoded;
- if (!X509Certificate::GetDEREncoded(os_handle, &der_encoded))
- return bssl::UniquePtr<X509>();
- const uint8_t* bytes = reinterpret_cast<const uint8_t*>(der_encoded.data());
- return bssl::UniquePtr<X509>(d2i_X509(NULL, &bytes, der_encoded.size()));
-#endif // defined(USE_OPENSSL_CERTS)
-}
-
-bssl::UniquePtr<STACK_OF(X509)> OSCertHandlesToOpenSSL(
- const X509Certificate::OSCertHandles& os_handles) {
- bssl::UniquePtr<STACK_OF(X509)> stack(sk_X509_new_null());
- for (size_t i = 0; i < os_handles.size(); i++) {
- bssl::UniquePtr<X509> x509 = OSCertHandleToOpenSSL(os_handles[i]);
- if (!x509)
- return nullptr;
- sk_X509_push(stack.get(), x509.release());
- }
- return stack;
-}
-
} // namespace net
« no previous file with comments | « net/ssl/openssl_ssl_util.h ('k') | net/ssl/ssl_client_session_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698