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

Unified Diff: net/socket/ssl_client_socket_unittest.cc

Issue 2382983002: Remove the last of the TLS fallback code. (Closed)
Patch Set: mmenke comments Created 4 years, 2 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_impl.cc ('k') | net/ssl/openssl_ssl_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_unittest.cc
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc
index 6e9f4b49afc47af7eb40c4611601d2156b80e186..be84e788aae38dd005f4df73f4da86afc8690963 100644
--- a/net/socket/ssl_client_socket_unittest.cc
+++ b/net/socket/ssl_client_socket_unittest.cc
@@ -1253,8 +1253,7 @@ TEST_F(SSLClientSocketTest, Read) {
}
// Tests that SSLClientSocket properly handles when the underlying transport
-// synchronously fails a transport read in during the handshake. The error code
-// should be preserved so SSLv3 fallback logic can condition on it.
+// synchronously fails a transport read in during the handshake.
TEST_F(SSLClientSocketTest, Connect_WithSynchronousError) {
ASSERT_TRUE(StartTestServer(SpawnedTestServer::SSLOptions()));
@@ -2653,62 +2652,6 @@ TEST_F(SSLClientSocketTest, CertificateErrorNoResume) {
EXPECT_EQ(SSLInfo::HANDSHAKE_FULL, ssl_info.handshake_type);
}
-// Tests that session caches are sharded by max_version.
-TEST_F(SSLClientSocketTest, FallbackShardSessionCache) {
- ASSERT_TRUE(StartTestServer(SpawnedTestServer::SSLOptions()));
-
- // Prepare a normal and fallback SSL config.
- SSLConfig ssl_config;
- SSLConfig fallback_ssl_config;
- fallback_ssl_config.version_max = SSL_PROTOCOL_VERSION_TLS1;
- fallback_ssl_config.version_fallback_min = SSL_PROTOCOL_VERSION_TLS1;
- fallback_ssl_config.version_fallback = true;
-
- // Connect with a fallback config from the test server to add an entry to the
- // session cache.
- int rv;
- ASSERT_TRUE(CreateAndConnectSSLClientSocket(fallback_ssl_config, &rv));
- EXPECT_THAT(rv, IsOk());
- SSLInfo ssl_info;
- EXPECT_TRUE(sock_->GetSSLInfo(&ssl_info));
- EXPECT_EQ(SSLInfo::HANDSHAKE_FULL, ssl_info.handshake_type);
- EXPECT_EQ(SSL_CONNECTION_VERSION_TLS1,
- SSLConnectionStatusToVersion(ssl_info.connection_status));
-
- // A non-fallback connection needs a full handshake.
- ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
- EXPECT_THAT(rv, IsOk());
- EXPECT_TRUE(sock_->GetSSLInfo(&ssl_info));
- EXPECT_EQ(SSLInfo::HANDSHAKE_FULL, ssl_info.handshake_type);
- EXPECT_EQ(SSL_CONNECTION_VERSION_TLS1_2,
- SSLConnectionStatusToVersion(ssl_info.connection_status));
-
- // Note: if the server (correctly) declines to resume a TLS 1.0 session at TLS
- // 1.2, the above test would not be sufficient to prove the session caches are
- // sharded. Implementations vary here, so, to avoid being sensitive to this,
- // attempt to resume with two more connections.
-
- // The non-fallback connection added a > TLS 1.0 entry to the session cache.
- ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
- EXPECT_THAT(rv, IsOk());
- EXPECT_TRUE(sock_->GetSSLInfo(&ssl_info));
- EXPECT_EQ(SSLInfo::HANDSHAKE_RESUME, ssl_info.handshake_type);
- // This does not check for equality because TLS 1.2 support is conditional on
- // system NSS features.
- EXPECT_LT(SSL_CONNECTION_VERSION_TLS1,
- SSLConnectionStatusToVersion(ssl_info.connection_status));
-
- // The fallback connection still resumes from its session cache. It cannot
- // offer the > TLS 1.0 session, so this must have been the session from the
- // first fallback connection.
- ASSERT_TRUE(CreateAndConnectSSLClientSocket(fallback_ssl_config, &rv));
- EXPECT_THAT(rv, IsOk());
- EXPECT_TRUE(sock_->GetSSLInfo(&ssl_info));
- EXPECT_EQ(SSLInfo::HANDSHAKE_RESUME, ssl_info.handshake_type);
- EXPECT_EQ(SSL_CONNECTION_VERSION_TLS1,
- SSLConnectionStatusToVersion(ssl_info.connection_status));
-}
-
// Test that DHE is removed but gives a dedicated error. Also test that the
// dhe_enabled option can restore it.
TEST_F(SSLClientSocketTest, DHE) {
« no previous file with comments | « net/socket/ssl_client_socket_impl.cc ('k') | net/ssl/openssl_ssl_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698