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

Unified Diff: net/socket_stream/socket_stream.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/socket/ssl_server_socket_unittest.cc ('k') | remoting/protocol/jingle_stream_connector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket_stream/socket_stream.cc
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index d89c074a061fe00a0db631fdbeab487b541c93f6..b8e977356f338427aec7608da6f61c53e3502f35 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -877,7 +877,8 @@ int SocketStream::DoSSLConnectComplete(int result) {
reinterpret_cast<SSLClientSocket*>(socket_.get());
SSLInfo ssl_info;
ssl_socket->GetSSLInfo(&ssl_info);
- if (ssl_config_.IsAllowedBadCert(ssl_info.cert, NULL)) {
+ if (ssl_info.cert == NULL ||
+ ssl_config_.IsAllowedBadCert(ssl_info.cert, NULL)) {
// If we already have the certificate in the set of allowed bad
// certificates, we did try it and failed again, so we should not
// retry again: the connection should fail at last.
@@ -887,7 +888,10 @@ int SocketStream::DoSSLConnectComplete(int result) {
// Add the bad certificate to the set of allowed certificates in the
// SSL config object.
SSLConfig::CertAndStatus bad_cert;
- bad_cert.cert = ssl_info.cert;
+ if (!ssl_info.cert->GetDEREncoded(&bad_cert.der_cert)) {
+ next_state_ = STATE_CLOSE;
+ return result;
+ }
bad_cert.cert_status = ssl_info.cert_status;
ssl_config_.allowed_bad_certs.push_back(bad_cert);
// Restart connection ignoring the bad certificate.
« no previous file with comments | « net/socket/ssl_server_socket_unittest.cc ('k') | remoting/protocol/jingle_stream_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698