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

Unified Diff: net/quic/test_tools/crypto_test_utils.cc

Issue 1437893002: Add token binding negotiation to QUIC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@107261172
Patch Set: Created 5 years, 1 month 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/quic/test_tools/crypto_test_utils.h ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/crypto_test_utils.cc
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc
index 1f4b456a1cfb5fefb93832dee50169c3583041a9..f88088e13420457ad025640c0de00d9dc7116faa 100644
--- a/net/quic/test_tools/crypto_test_utils.cc
+++ b/net/quic/test_tools/crypto_test_utils.cc
@@ -121,14 +121,20 @@ class AsyncTestChannelIDSource : public ChannelIDSource,
} // anonymous namespace
+CryptoTestUtils::FakeServerOptions::FakeServerOptions()
+ : token_binding_enabled(false) {}
+
CryptoTestUtils::FakeClientOptions::FakeClientOptions()
- : channel_id_enabled(false), channel_id_source_async(false) {}
+ : channel_id_enabled(false),
+ channel_id_source_async(false),
+ token_binding_enabled(false) {}
// static
int CryptoTestUtils::HandshakeWithFakeServer(
MockConnectionHelper* helper,
PacketSavingConnection* client_conn,
- QuicCryptoClientStream* client) {
+ QuicCryptoClientStream* client,
+ const FakeServerOptions& options) {
PacketSavingConnection* server_conn = new PacketSavingConnection(
helper, Perspective::IS_SERVER, client_conn->supported_versions());
@@ -138,7 +144,7 @@ int CryptoTestUtils::HandshakeWithFakeServer(
ProofSourceForTesting());
SetupCryptoServerConfigForTest(server_conn->clock(),
server_conn->random_generator(), &config,
- &crypto_config);
+ &crypto_config, options);
TestQuicSpdyServerSession server_session(server_conn, config, &crypto_config);
@@ -175,6 +181,9 @@ int CryptoTestUtils::HandshakeWithFakeClient(
}
crypto_config.SetChannelIDSource(source);
}
+ if (options.token_binding_enabled) {
+ crypto_config.tb_key_params.push_back(kP256);
+ }
TestQuicSpdyClientSession client_session(client_conn, DefaultQuicConfig(),
server_id, &crypto_config);
@@ -207,9 +216,11 @@ void CryptoTestUtils::SetupCryptoServerConfigForTest(
const QuicClock* clock,
QuicRandom* rand,
QuicConfig* config,
- QuicCryptoServerConfig* crypto_config) {
+ QuicCryptoServerConfig* crypto_config,
+ const FakeServerOptions& fake_options) {
QuicCryptoServerConfig::ConfigOptions options;
options.channel_id_enabled = true;
+ options.token_binding_enabled = fake_options.token_binding_enabled;
scoped_ptr<CryptoHandshakeMessage> scfg(
crypto_config->AddDefaultConfig(rand, clock, options));
}
« no previous file with comments | « net/quic/test_tools/crypto_test_utils.h ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698