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

Unified Diff: net/socket/ssl_client_socket_win.cc

Issue 147159: Fix a crash in net::SSLClientSocketWin::OnIOComplete(int) when... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Upload before checkin Created 11 years, 6 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_client_socket_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_win.cc
===================================================================
--- net/socket/ssl_client_socket_win.cc (revision 19275)
+++ net/socket/ssl_client_socket_win.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/singleton.h"
#include "base/stl_util-inl.h"
#include "base/string_util.h"
+#include "net/base/cert_verifier.h"
#include "net/base/connection_type_histograms.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -477,6 +478,8 @@
void SSLClientSocketWin::Disconnect() {
// TODO(wtc): Send SSL close_notify alert.
completed_handshake_ = false;
+ // Shut down anything that may call us back through io_callback_.
+ verifier_.reset();
transport_->Disconnect();
if (send_buffer_.pvBuffer)
@@ -853,11 +856,15 @@
flags |= X509Certificate::VERIFY_REV_CHECKING_ENABLED;
if (ssl_config_.verify_ev_cert)
flags |= X509Certificate::VERIFY_EV_CERT;
- return verifier_.Verify(server_cert_, hostname_, flags,
- &server_cert_verify_result_, &io_callback_);
+ verifier_.reset(new CertVerifier);
+ return verifier_->Verify(server_cert_, hostname_, flags,
+ &server_cert_verify_result_, &io_callback_);
}
int SSLClientSocketWin::DoVerifyCertComplete(int result) {
+ DCHECK(verifier_.get());
+ verifier_.reset();
+
// If we have been explicitly told to accept this certificate, override the
// result of verifier_.Verify.
// Eventually, we should cache the cert verification results so that we don't
« no previous file with comments | « net/socket/ssl_client_socket_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698