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

Unified Diff: net/test/spawned_test_server/base_test_server.cc

Issue 342793003: Add tests for TLS fallback on connection reset and close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wtc comments Created 6 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/test/spawned_test_server/base_test_server.h ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/spawned_test_server/base_test_server.cc
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
index 016c9301edf69ee18bbed20f2805567b0d26eeff..2ee9adc9b05b201c1fd153bd6200ac7f6363cf4e 100644
--- a/net/test/spawned_test_server/base_test_server.cc
+++ b/net/test/spawned_test_server/base_test_server.cc
@@ -72,6 +72,21 @@ void GetCiphersList(int cipher, base::ListValue* values) {
values->Append(new base::StringValue("3des"));
}
+base::StringValue* GetTLSIntoleranceType(
+ BaseTestServer::SSLOptions::TLSIntoleranceType type) {
+ switch (type) {
+ case BaseTestServer::SSLOptions::TLS_INTOLERANCE_ALERT:
+ return new base::StringValue("alert");
+ case BaseTestServer::SSLOptions::TLS_INTOLERANCE_CLOSE:
+ return new base::StringValue("close");
+ case BaseTestServer::SSLOptions::TLS_INTOLERANCE_RESET:
+ return new base::StringValue("reset");
+ default:
+ NOTREACHED();
+ return new base::StringValue("");
+ }
+}
+
} // namespace
BaseTestServer::SSLOptions::SSLOptions()
@@ -83,6 +98,7 @@ BaseTestServer::SSLOptions::SSLOptions()
bulk_ciphers(SSLOptions::BULK_CIPHER_ANY),
record_resume(false),
tls_intolerant(TLS_INTOLERANT_NONE),
+ tls_intolerance_type(TLS_INTOLERANCE_ALERT),
fallback_scsv_enabled(false),
staple_ocsp_response(false),
enable_npn(false) {}
@@ -97,6 +113,7 @@ BaseTestServer::SSLOptions::SSLOptions(
bulk_ciphers(SSLOptions::BULK_CIPHER_ANY),
record_resume(false),
tls_intolerant(TLS_INTOLERANT_NONE),
+ tls_intolerance_type(TLS_INTOLERANCE_ALERT),
fallback_scsv_enabled(false),
staple_ocsp_response(false),
enable_npn(false) {}
@@ -437,6 +454,8 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
if (ssl_options_.tls_intolerant != SSLOptions::TLS_INTOLERANT_NONE) {
arguments->Set("tls-intolerant",
new base::FundamentalValue(ssl_options_.tls_intolerant));
+ arguments->Set("tls-intolerance-type", GetTLSIntoleranceType(
+ ssl_options_.tls_intolerance_type));
}
if (ssl_options_.fallback_scsv_enabled)
arguments->Set("fallback-scsv", base::Value::CreateNullValue());
« no previous file with comments | « net/test/spawned_test_server/base_test_server.h ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698