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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 7401003: Don't use X509Certificate in SSLConfig. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 5 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/base/x509_certificate.cc ('k') | net/socket/ssl_client_socket_nss.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job.cc
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index 417857b7c9046cd0d35e295d2fd4a70e2c31eb5f..dcbf1149f24ba7dfa93f43a365c1048c8d851fc6 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -1013,7 +1013,13 @@ int HttpStreamFactoryImpl::Job::HandleCertificateError(int error) {
// RestartIgnoringLastError(). And the user will be asked interactively
// before RestartIgnoringLastError() is ever called.
SSLConfig::CertAndStatus bad_cert;
- bad_cert.cert = ssl_info_.cert;
+
+ // |ssl_info_.cert| may be NULL if we failed to create
+ // X509Certificate for whatever reason, but normally it shouldn't
+ // happen, unless this code is used inside sandbox.
+ if (ssl_info_.cert == NULL ||
+ !ssl_info_.cert->GetDEREncoded(&bad_cert.der_cert))
+ return error;
bad_cert.cert_status = ssl_info_.cert_status;
ssl_config_.allowed_bad_certs.push_back(bad_cert);
« no previous file with comments | « net/base/x509_certificate.cc ('k') | net/socket/ssl_client_socket_nss.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698