diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-17 07:22:41 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-17 07:22:41 +0000 |
commit | 791879c16116cf2f93e6513c6699feed2dd3c2cd (patch) | |
tree | f9fbbecb2f16e7085f35409a2273a7c52f3463b5 /net/http | |
parent | 4cdeadad58ab378f31b5c63cc3197a91198d4d6d (diff) | |
download | chromium_src-791879c16116cf2f93e6513c6699feed2dd3c2cd.zip chromium_src-791879c16116cf2f93e6513c6699feed2dd3c2cd.tar.gz chromium_src-791879c16116cf2f93e6513c6699feed2dd3c2cd.tar.bz2 |
Change SSLCertRequestInfo.host_and_port from string to HostPortPair.
Change ShowCryptoModulePasswordDialog to explicitly specify that the string
it takes is a hostname.
BUG=none
Review URL: https://codereview.chromium.org/106223003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_network_transaction.cc | 2 | ||||
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 38 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl_job.cc | 2 |
3 files changed, 21 insertions, 21 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 66d7364..a6d5069 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -1291,7 +1291,7 @@ void HttpNetworkTransaction::HandleClientAuthError(int error) { if (server_ssl_config_.send_client_cert && (error == ERR_SSL_PROTOCOL_ERROR || IsClientCertificateError(error))) { session_->ssl_client_auth_cache()->Remove( - GetHostAndPort(request_->url)); + HostPortPair::FromURL(request_->url)); } } diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index dd9eefe..6df20ac 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -10130,7 +10130,7 @@ TEST_P(HttpNetworkTransactionTest, request_info.load_flags = net::LOAD_NORMAL; scoped_refptr<SSLCertRequestInfo> cert_request(new SSLCertRequestInfo()); - cert_request->host_and_port = "www.example.com:443"; + cert_request->host_and_port = HostPortPair("www.example.com", 443); // [ssl_]data1 contains the data for the first SSL handshake. When a // CertificateRequest is received for the first time, the handshake will @@ -10210,8 +10210,8 @@ TEST_P(HttpNetworkTransactionTest, // Ensure the certificate was added to the client auth cache before // allowing the connection to continue restarting. scoped_refptr<X509Certificate> client_cert; - ASSERT_TRUE(session->ssl_client_auth_cache()->Lookup("www.example.com:443", - &client_cert)); + ASSERT_TRUE(session->ssl_client_auth_cache()->Lookup( + HostPortPair("www.example.com", 443), &client_cert)); ASSERT_EQ(NULL, client_cert.get()); // Restart the handshake. This will consume ssl_data2, which fails, and @@ -10222,8 +10222,8 @@ TEST_P(HttpNetworkTransactionTest, // Ensure that the client certificate is removed from the cache on a // handshake failure. - ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup("www.example.com:443", - &client_cert)); + ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup( + HostPortPair("www.example.com", 443), &client_cert)); } // Ensure that a client certificate is removed from the SSL client auth @@ -10240,7 +10240,7 @@ TEST_P(HttpNetworkTransactionTest, request_info.load_flags = net::LOAD_NORMAL; scoped_refptr<SSLCertRequestInfo> cert_request(new SSLCertRequestInfo()); - cert_request->host_and_port = "www.example.com:443"; + cert_request->host_and_port = HostPortPair("www.example.com", 443); // When TLS False Start is used, SSLClientSocket::Connect() calls will // return successfully after reading up to the peer's Certificate message. @@ -10331,8 +10331,8 @@ TEST_P(HttpNetworkTransactionTest, // Ensure the certificate was added to the client auth cache before // allowing the connection to continue restarting. scoped_refptr<X509Certificate> client_cert; - ASSERT_TRUE(session->ssl_client_auth_cache()->Lookup("www.example.com:443", - &client_cert)); + ASSERT_TRUE(session->ssl_client_auth_cache()->Lookup( + HostPortPair("www.example.com", 443), &client_cert)); ASSERT_EQ(NULL, client_cert.get()); // Restart the handshake. This will consume ssl_data2, which fails, and @@ -10343,8 +10343,8 @@ TEST_P(HttpNetworkTransactionTest, // Ensure that the client certificate is removed from the cache on a // handshake failure. - ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup("www.example.com:443", - &client_cert)); + ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup( + HostPortPair("www.example.com", 443), &client_cert)); } // Ensure that a client certificate is removed from the SSL client auth @@ -10362,7 +10362,7 @@ TEST_P(HttpNetworkTransactionTest, ClientAuthCertCache_Proxy_Fail) { session_deps_.net_log = log.bound().net_log(); scoped_refptr<SSLCertRequestInfo> cert_request(new SSLCertRequestInfo()); - cert_request->host_and_port = "proxy:70"; + cert_request->host_and_port = HostPortPair("proxy", 70); // See ClientAuthCertCache_Direct_NoFalseStart for the explanation of // [ssl_]data[1-3]. Rather than represending the endpoint @@ -10425,13 +10425,13 @@ TEST_P(HttpNetworkTransactionTest, ClientAuthCertCache_Proxy_Fail) { // Ensure the certificate was added to the client auth cache before // allowing the connection to continue restarting. scoped_refptr<X509Certificate> client_cert; - ASSERT_TRUE(session->ssl_client_auth_cache()->Lookup("proxy:70", - &client_cert)); + ASSERT_TRUE(session->ssl_client_auth_cache()->Lookup( + HostPortPair("proxy", 70), &client_cert)); ASSERT_EQ(NULL, client_cert.get()); // Ensure the certificate was NOT cached for the endpoint. This only // applies to HTTPS requests, but is fine to check for HTTP requests. - ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup("www.example.com:443", - &client_cert)); + ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup( + HostPortPair("www.example.com", 443), &client_cert)); // Restart the handshake. This will consume ssl_data2, which fails, and // then consume ssl_data3, which should also fail. The result code is @@ -10441,10 +10441,10 @@ TEST_P(HttpNetworkTransactionTest, ClientAuthCertCache_Proxy_Fail) { // Now that the new handshake has failed, ensure that the client // certificate was removed from the client auth cache. - ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup("proxy:70", - &client_cert)); - ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup("www.example.com:443", - &client_cert)); + ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup( + HostPortPair("proxy", 70), &client_cert)); + ASSERT_FALSE(session->ssl_client_auth_cache()->Lookup( + HostPortPair("www.example.com", 443), &client_cert)); } } diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index c86bee7..d60c522 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc @@ -1338,7 +1338,7 @@ int HttpStreamFactoryImpl::Job::ReconsiderProxyAfterError(int error) { if (proxy_info_.is_https() && proxy_ssl_config_.send_client_cert) { session_->ssl_client_auth_cache()->Remove( - proxy_info_.proxy_server().host_port_pair().ToString()); + proxy_info_.proxy_server().host_port_pair()); } int rv = session_->proxy_service()->ReconsiderProxyAfterError( |