| 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));
|
| }
|
|
|