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

Unified Diff: net/socket/ssl_client_socket_unittest.cc

Issue 2056343006: Remove DHE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 4 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
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 ad710632692da937fb2488ec86a69173346434d0..37a1cd16371ae896e03daa6c018e7ea8e616d60a 100644
--- a/net/socket/ssl_client_socket_unittest.cc
+++ b/net/socket/ssl_client_socket_unittest.cc
@@ -2625,22 +2625,33 @@ TEST_F(SSLClientSocketTest, FallbackShardSessionCache) {
SSLConnectionStatusToVersion(ssl_info.connection_status));
}
-// Test that DHE is only enabled if deprecated_cipher_suites_enabled is set.
-TEST_F(SSLClientSocketTest, DHEDeprecated) {
+// Test that DHE is removed but gives a dedicated error. Also test that the
+// dhe_enabled option can restore it.
+TEST_F(SSLClientSocketTest, DHE) {
SpawnedTestServer::SSLOptions ssl_options;
ssl_options.key_exchanges =
SpawnedTestServer::SSLOptions::KEY_EXCHANGE_DHE_RSA;
ASSERT_TRUE(StartTestServer(ssl_options));
- // Normal handshakes with DHE do not work.
+ // Normal handshakes with DHE do not work, with or without DHE enabled.
SSLConfig ssl_config;
int rv;
ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
EXPECT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, rv);
- // Enabling deprecated ciphers works fine.
+ ssl_config.dhe_enabled = true;
+ ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
+ EXPECT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, rv);
+
+ // Enabling deprecated ciphers gives DHE a dedicated error code.
+ ssl_config.dhe_enabled = false;
ssl_config.deprecated_cipher_suites_enabled = true;
ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
+ EXPECT_EQ(ERR_SSL_OBSOLETE_CIPHER, rv);
+
+ // Enabling both deprecated ciphers and DHE restores it.
+ ssl_config.dhe_enabled = true;
+ ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
EXPECT_EQ(OK, rv);
}

Powered by Google App Engine
This is Rietveld 408576698