Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maskit committed Jul 14, 2020
1 parent 32fb67f commit 00d7883
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
21 changes: 21 additions & 0 deletions iocore/net/quic/test/test_QUICHandshakeProtocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ TEST_CASE("QUICHandshakeProtocol")
QUICPacketPayloadProtector ppp_client(pp_key_info_client);
QUICPacketPayloadProtector ppp_server(pp_key_info_server);

auto client_tp = std::make_shared<QUICTransportParametersInClientHello>();
auto server_tp = std::make_shared<QUICTransportParametersInEncryptedExtensions>();
client_tp->set(QUICTransportParameterId::MAX_IDLE_TIMEOUT, 10);
server_tp->set(QUICTransportParameterId::MAX_IDLE_TIMEOUT, 10);
client->set_local_transport_parameters(client_tp);
server->set_local_transport_parameters(server_tp);

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

Expand Down Expand Up @@ -230,6 +237,13 @@ TEST_CASE("QUICHandshakeProtocol")
QUICPacketPayloadProtector ppp_client(pp_key_info_client);
QUICPacketPayloadProtector ppp_server(pp_key_info_server);

auto client_tp = std::make_shared<QUICTransportParametersInClientHello>();
auto server_tp = std::make_shared<QUICTransportParametersInEncryptedExtensions>();
client_tp->set(QUICTransportParameterId::MAX_IDLE_TIMEOUT, 10);
server_tp->set(QUICTransportParameterId::MAX_IDLE_TIMEOUT, 10);
client->set_local_transport_parameters(client_tp);
server->set_local_transport_parameters(server_tp);

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

Expand Down Expand Up @@ -390,6 +404,13 @@ TEST_CASE("QUICHandshakeProtocol")
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);

auto client_tp = std::make_shared<QUICTransportParametersInClientHello>();
auto server_tp = std::make_shared<QUICTransportParametersInEncryptedExtensions>();
client_tp->set(QUICTransportParameterId::MAX_IDLE_TIMEOUT, 10);
server_tp->set(QUICTransportParameterId::MAX_IDLE_TIMEOUT, 10);
client->set_local_transport_parameters(client_tp);
server->set_local_transport_parameters(server_tp);

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

Expand Down
7 changes: 7 additions & 0 deletions iocore/net/quic/test/test_QUICPacketHeaderProtector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ TEST_CASE("QUICPacketHeaderProtector")
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);

auto client_tp = std::make_shared<QUICTransportParametersInClientHello>();
auto server_tp = std::make_shared<QUICTransportParametersInEncryptedExtensions>();
client_tp->set(QUICTransportParameterId::MAX_IDLE_TIMEOUT, 10);
server_tp->set(QUICTransportParameterId::MAX_IDLE_TIMEOUT, 10);
client->set_local_transport_parameters(client_tp);
server->set_local_transport_parameters(server_tp);

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

Expand Down

0 comments on commit 00d7883

Please sign in to comment.