diff options
author | davidben <davidben@chromium.org> | 2015-04-24 14:50:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-24 21:50:05 +0000 |
commit | 9bbf3290520788bfe634a286a30965cd43f4dd78 (patch) | |
tree | f0cbfaa93f55bfdf4e5d69afdebf9a530cc152ed /net | |
parent | 9ba360de4cee36a01a5f5b3b7c5cd6e65eb6748b (diff) | |
download | chromium_src-9bbf3290520788bfe634a286a30965cd43f4dd78.zip chromium_src-9bbf3290520788bfe634a286a30965cd43f4dd78.tar.gz chromium_src-9bbf3290520788bfe634a286a30965cd43f4dd78.tar.bz2 |
Pass in a non-null CertVerifier into SSLClientSocket.
SslHmacChannelAuthenticator passes in a null one which crashes but the
IsAllowedBadCert check, as well as inconsistent ability to use X509Certificate
in the sandbox masks the issue most of the time.
This also fixes FakeStreamSocket to propogate disconnects to the peer, which is
needed to add a test for this case. (If SSLClientSocket doesn't like a
certificate, it just ceremoniously disconnects the connection right after the
handshake.) This test crashed before this CL outside the sandbox. (Inside the
sandbox, it's possible that it worked on some platforms due to the sandbox
breaking net::X509Certificate. I didn't do a survey.)
BUG=none
Review URL: https://codereview.chromium.org/1080593003
Cr-Commit-Position: refs/heads/master@{#326886}
Diffstat (limited to 'net')
-rw-r--r-- | net/socket/ssl_client_socket_nss.cc | 2 | ||||
-rw-r--r-- | net/socket/ssl_client_socket_openssl.cc | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc index 16641f9..43614c8 100644 --- a/net/socket/ssl_client_socket_nss.cc +++ b/net/socket/ssl_client_socket_nss.cc @@ -2444,6 +2444,8 @@ SSLClientSocketNSS::SSLClientSocketNSS( transport_security_state_(context.transport_security_state), policy_enforcer_(context.cert_policy_enforcer), valid_thread_id_(base::kInvalidThreadId) { + DCHECK(cert_verifier_); + EnterFunction(""); InitCore(); LeaveFunction(""); diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc index 7b11ddc..fb739f4 100644 --- a/net/socket/ssl_client_socket_openssl.cc +++ b/net/socket/ssl_client_socket_openssl.cc @@ -389,6 +389,7 @@ SSLClientSocketOpenSSL::SSLClientSocketOpenSSL( policy_enforcer_(context.cert_policy_enforcer), net_log_(transport_->socket()->NetLog()), weak_factory_(this) { + DCHECK(cert_verifier_); } SSLClientSocketOpenSSL::~SSLClientSocketOpenSSL() { |