diff options
author | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-11 20:49:33 +0000 |
---|---|---|
committer | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-11 20:49:33 +0000 |
commit | 5b799829d960aacd61484641917d4aa9ce971a92 (patch) | |
tree | 7c67c542465f354bf1b024366ebdfea28b455000 /net/test | |
parent | ce24d87b83bae1c84e3812c1bfbb90dc9d5931e7 (diff) | |
download | chromium_src-5b799829d960aacd61484641917d4aa9ce971a92.zip chromium_src-5b799829d960aacd61484641917d4aa9ce971a92.tar.gz chromium_src-5b799829d960aacd61484641917d4aa9ce971a92.tar.bz2 |
Add False Start tests
Tests both that False Start occurs when it should and doesn't
when it shouldn't.
BUG=354132
Review URL: https://codereview.chromium.org/208293002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/test')
-rw-r--r-- | net/test/spawned_test_server/base_test_server.cc | 22 | ||||
-rw-r--r-- | net/test/spawned_test_server/base_test_server.h | 20 |
2 files changed, 40 insertions, 2 deletions
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc index ac37c70..a781c6e 100644 --- a/net/test/spawned_test_server/base_test_server.cc +++ b/net/test/spawned_test_server/base_test_server.cc @@ -40,6 +40,13 @@ std::string GetHostname(BaseTestServer::Type type, return BaseTestServer::kLocalhost; } +void GetKeyExchangesList(int key_exchange, base::ListValue* values) { + if (key_exchange & BaseTestServer::SSLOptions::KEY_EXCHANGE_RSA) + values->Append(new base::StringValue("rsa")); + if (key_exchange & BaseTestServer::SSLOptions::KEY_EXCHANGE_DHE_RSA) + values->Append(new base::StringValue("dhe_rsa")); +} + void GetCiphersList(int cipher, base::ListValue* values) { if (cipher & BaseTestServer::SSLOptions::BULK_CIPHER_RC4) values->Append(new base::StringValue("rc4")); @@ -58,11 +65,13 @@ BaseTestServer::SSLOptions::SSLOptions() ocsp_status(OCSP_OK), cert_serial(0), request_client_certificate(false), + key_exchanges(SSLOptions::KEY_EXCHANGE_ANY), bulk_ciphers(SSLOptions::BULK_CIPHER_ANY), record_resume(false), tls_intolerant(TLS_INTOLERANT_NONE), fallback_scsv_enabled(false), - staple_ocsp_response(false) {} + staple_ocsp_response(false), + enable_npn(false) {} BaseTestServer::SSLOptions::SSLOptions( BaseTestServer::SSLOptions::ServerCertificate cert) @@ -70,11 +79,13 @@ BaseTestServer::SSLOptions::SSLOptions( ocsp_status(OCSP_OK), cert_serial(0), request_client_certificate(false), + key_exchanges(SSLOptions::KEY_EXCHANGE_ANY), bulk_ciphers(SSLOptions::BULK_CIPHER_ANY), record_resume(false), tls_intolerant(TLS_INTOLERANT_NONE), fallback_scsv_enabled(false), - staple_ocsp_response(false) {} + staple_ocsp_response(false), + enable_npn(false) {} BaseTestServer::SSLOptions::~SSLOptions() {} @@ -389,6 +400,11 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const { base::Value::CreateIntegerValue(ssl_options_.cert_serial)); } + // Check key exchange argument. + scoped_ptr<base::ListValue> key_exchange_values(new base::ListValue()); + GetKeyExchangesList(ssl_options_.key_exchanges, key_exchange_values.get()); + if (key_exchange_values->GetSize()) + arguments->Set("ssl-key-exchange", key_exchange_values.release()); // Check bulk cipher argument. scoped_ptr<base::ListValue> bulk_cipher_values(new base::ListValue()); GetCiphersList(ssl_options_.bulk_ciphers, bulk_cipher_values.get()); @@ -410,6 +426,8 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const { } if (ssl_options_.staple_ocsp_response) arguments->Set("staple-ocsp-response", base::Value::CreateNullValue()); + if (ssl_options_.enable_npn) + arguments->Set("enable-npn", base::Value::CreateNullValue()); } return GenerateAdditionalArguments(arguments); diff --git a/net/test/spawned_test_server/base_test_server.h b/net/test/spawned_test_server/base_test_server.h index 163808c..392a72b 100644 --- a/net/test/spawned_test_server/base_test_server.h +++ b/net/test/spawned_test_server/base_test_server.h @@ -72,6 +72,18 @@ class BaseTestServer { OCSP_UNKNOWN, }; + // Bitmask of key exchange algorithms that the test server supports and that + // can be selectively enabled or disabled. + enum KeyExchange { + // Special value used to indicate that any algorithm the server supports + // is acceptable. Preferred over explicitly OR-ing all key exchange + // algorithms. + KEY_EXCHANGE_ANY = 0, + + KEY_EXCHANGE_RSA = (1 << 0), + KEY_EXCHANGE_DHE_RSA = (1 << 1), + }; + // Bitmask of bulk encryption algorithms that the test server supports // and that can be selectively enabled or disabled. enum BulkCipher { @@ -134,6 +146,11 @@ class BaseTestServer { // field of the CertificateRequest. std::vector<base::FilePath> client_authorities; + // A bitwise-OR of KeyExchnage that should be used by the + // HTTPS server, or KEY_EXCHANGE_ANY to indicate that all implemented + // key exchange algorithms are acceptable. + int key_exchanges; + // A bitwise-OR of BulkCipher that should be used by the // HTTPS server, or BULK_CIPHER_ANY to indicate that all implemented // ciphers are acceptable. @@ -165,6 +182,9 @@ class BaseTestServer { // Whether to staple the OCSP response. bool staple_ocsp_response; + + // Whether to enable NPN support. + bool enable_npn; }; // Pass as the 'host' parameter during construction to server on 127.0.0.1 |