This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/quic-latest by this push:
new 2fe722d Fix unit tests using QUICTLS
2fe722d is described below
commit 2fe722da117beb99a1f22e918a3ef1c3060f1450
Author: Masaori Koshiba <[email protected]>
AuthorDate: Wed Apr 10 13:52:24 2019 +0900
Fix unit tests using QUICTLS
---
iocore/net/quic/test/test_QUICHandshakeProtocol.cc | 18 +++++++++++-------
iocore/net/quic/test/test_QUICPacketHeaderProtector.cc | 10 ++++++----
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/iocore/net/quic/test/test_QUICHandshakeProtocol.cc
b/iocore/net/quic/test/test_QUICHandshakeProtocol.cc
index 53b32d9..aac2e6c 100644
--- a/iocore/net/quic/test/test_QUICHandshakeProtocol.cc
+++ b/iocore/net/quic/test/test_QUICHandshakeProtocol.cc
@@ -99,8 +99,9 @@ TEST_CASE("QUICHandshakeProtocol")
{
QUICPacketProtectionKeyInfo pp_key_info_client;
QUICPacketProtectionKeyInfo pp_key_info_server;
- QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT);
- QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN);
+ NetVCOptions netvc_options;
+ QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT, netvc_options);
+ QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN, netvc_options);
QUICPacketPayloadProtector ppp_client(pp_key_info_client);
QUICPacketPayloadProtector ppp_server(pp_key_info_server);
@@ -226,8 +227,9 @@ TEST_CASE("QUICHandshakeProtocol")
QUICPacketProtectionKeyInfo pp_key_info_client;
QUICPacketProtectionKeyInfo pp_key_info_server;
- QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT);
- QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN);
+ NetVCOptions netvc_options;
+ QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT, netvc_options);
+ QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN, netvc_options);
QUICPacketPayloadProtector ppp_client(pp_key_info_client);
QUICPacketPayloadProtector ppp_server(pp_key_info_server);
@@ -365,7 +367,8 @@ TEST_CASE("QUICHandshakeProtocol")
SECTION("Alert", "[quic]")
{
QUICPacketProtectionKeyInfo pp_key_info_server;
- QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN);
+ NetVCOptions netvc_options;
+ QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN, netvc_options);
CHECK(server->initialize_key_materials({reinterpret_cast<const uint8_t
*>("\x83\x94\xc8\xf0\x3e\x51\x57\x00"), 8}));
// Malformed CH (finished)
@@ -400,8 +403,9 @@ TEST_CASE("QUICHandshakeProtocol")
{
QUICPacketProtectionKeyInfo pp_key_info_client;
QUICPacketProtectionKeyInfo pp_key_info_server;
- QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT);
- QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN);
+ NetVCOptions netvc_options;
+ QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT, netvc_options);
+ QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN, netvc_options);
CHECK(client->initialize_key_materials({reinterpret_cast<const uint8_t
*>("\x83\x94\xc8\xf0\x3e\x51\x57\x00"), 8}));
CHECK(server->initialize_key_materials({reinterpret_cast<const uint8_t
*>("\x83\x94\xc8\xf0\x3e\x51\x57\x00"), 8}));
diff --git a/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc
b/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc
index c0ed905..52aed26 100644
--- a/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc
+++ b/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc
@@ -71,8 +71,9 @@ TEST_CASE("QUICPacketHeaderProtector")
QUICPacketProtectionKeyInfo pp_key_info_client;
QUICPacketProtectionKeyInfo pp_key_info_server;
- QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT);
- QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN);
+ NetVCOptions netvc_options;
+ QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT, netvc_options);
+ QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN, netvc_options);
CHECK(client->initialize_key_materials({reinterpret_cast<const uint8_t
*>("\x83\x94\xc8\xf0\x3e\x51\x57\x00"), 8}));
CHECK(server->initialize_key_materials({reinterpret_cast<const uint8_t
*>("\x83\x94\xc8\xf0\x3e\x51\x57\x00"), 8}));
@@ -104,8 +105,9 @@ TEST_CASE("QUICPacketHeaderProtector")
QUICPacketProtectionKeyInfo pp_key_info_client;
QUICPacketProtectionKeyInfo pp_key_info_server;
- QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT);
- QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN);
+ NetVCOptions netvc_options;
+ QUICHandshakeProtocol *client = new QUICTLS(pp_key_info_client,
client_ssl_ctx, NET_VCONNECTION_OUT, netvc_options);
+ QUICHandshakeProtocol *server = new QUICTLS(pp_key_info_server,
server_ssl_ctx, NET_VCONNECTION_IN, netvc_options);
CHECK(client->initialize_key_materials({reinterpret_cast<const uint8_t
*>("\x83\x94\xc8\xf0\x3e\x51\x57\x00"), 8}));
CHECK(server->initialize_key_materials({reinterpret_cast<const uint8_t
*>("\x83\x94\xc8\xf0\x3e\x51\x57\x00"), 8}));