From bd707a60326fbf47ecafba43480028178dfa109f Mon Sep 17 00:00:00 2001 From: "wtc@chromium.org" Date: Mon, 14 Mar 2011 23:29:34 +0000 Subject: Code cleanup related to allowed_bad_certs. cert_status is a bitwise-OR of CERT_STATUS_xxx, not ERR_CERT_xxx. Initialize a CertAndStatus structure after checking it is needed. Fix a typo in comments. R=hclam BUG=none TEST=none Review URL: http://codereview.chromium.org/6677022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78123 0039d316-1c4b-4281-b951-d872f2087c98 --- net/socket_stream/socket_stream.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'net/socket_stream/socket_stream.cc') diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc index 7733c5d..0a36525 100644 --- a/net/socket_stream/socket_stream.cc +++ b/net/socket_stream/socket_stream.cc @@ -832,9 +832,6 @@ int SocketStream::DoSSLConnectComplete(int result) { reinterpret_cast(socket_.get()); SSLInfo ssl_info; ssl_socket->GetSSLInfo(&ssl_info); - SSLConfig::CertAndStatus bad_cert; - bad_cert.cert = ssl_info.cert; - bad_cert.cert_status = ssl_info.cert_status; if (ssl_config_.IsAllowedBadCert(ssl_info.cert)) { // If we already have the certificate in the set of allowed bad // certificates, we did try it and failed again, so we should not @@ -843,7 +840,10 @@ int SocketStream::DoSSLConnectComplete(int result) { return result; } // Add the bad certificate to the set of allowed certificates in the - // SSL info object. + // SSL config object. + SSLConfig::CertAndStatus bad_cert; + bad_cert.cert = ssl_info.cert; + bad_cert.cert_status = ssl_info.cert_status; ssl_config_.allowed_bad_certs.push_back(bad_cert); // Restart connection ignoring the bad certificate. socket_->Disconnect(); -- cgit v1.1