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

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 comment 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
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..b5e9ef900db0d94eeaa2305f575ab00a25c64f2e 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 NULL;
wtc 2014/06/25 23:32:22 Should we return new base::StringValue("")?
davidben 2014/06/26 17:01:00 Done.
+ }
+}
+
} // 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());

Powered by Google App Engine
This is Rietveld 408576698