You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2017/12/13 23:44:33 UTC
[trafficserver] 01/08: draft-08: Support long header packet type &
format
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
commit 387788783bf1013b982474ee59ec095345c964dd
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Tue Dec 12 15:55:34 2017 +0900
draft-08: Support long header packet type & format
---
iocore/net/QUICNetVConnection.cc | 16 ++---
iocore/net/quic/QUICDebugNames.cc | 14 ++--
iocore/net/quic/QUICHandshake.cc | 2 +-
iocore/net/quic/QUICLossDetector.cc | 4 +-
iocore/net/quic/QUICPacket.cc | 77 ++++++++++++----------
iocore/net/quic/QUICPacket.h | 8 +--
iocore/net/quic/QUICTypes.h | 20 +++---
iocore/net/quic/test/test_QUICLossDetector.cc | 4 +-
iocore/net/quic/test/test_QUICPacket.cc | 41 ++++++++----
iocore/net/quic/test/test_QUICPacketFactory.cc | 6 +-
iocore/net/quic/test/test_QUICVersionNegotiator.cc | 3 +-
11 files changed, 106 insertions(+), 89 deletions(-)
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 226fcd2..013d1ee 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -596,10 +596,10 @@ QUICNetVConnection::_state_handshake_process_packet(QUICPacketUPtr packet)
{
QUICErrorUPtr error = QUICErrorUPtr(new QUICNoError());
switch (packet->type()) {
- case QUICPacketType::CLIENT_INITIAL:
+ case QUICPacketType::INITIAL:
error = this->_state_handshake_process_initial_client_packet(std::move(packet));
break;
- case QUICPacketType::CLIENT_CLEARTEXT:
+ case QUICPacketType::HANDSHAKE:
error = this->_state_handshake_process_client_cleartext_packet(std::move(packet));
break;
case QUICPacketType::ZERO_RTT_PROTECTED:
@@ -700,7 +700,7 @@ QUICNetVConnection::_state_common_receive_packet()
case QUICPacketType::PROTECTED:
error = this->_state_connection_established_process_packet(std::move(p));
break;
- case QUICPacketType::CLIENT_CLEARTEXT:
+ case QUICPacketType::HANDSHAKE:
// FIXME Just ignore for now but it has to be acked (GitHub#2609)
break;
default:
@@ -857,17 +857,17 @@ QUICNetVConnection::_build_packet(ats_unique_buf buf, size_t len, bool retransmi
QUICPacketUPtr packet = QUICPacketFactory::create_null_packet();
switch (type) {
- case QUICPacketType::SERVER_CLEARTEXT:
- packet = this->_packet_factory.create_server_cleartext_packet(this->_quic_connection_id, this->largest_acked_packet_number(),
- std::move(buf), len, retransmittable);
+ case QUICPacketType::HANDSHAKE:
+ packet = this->_packet_factory.create_handshake_packet(this->_quic_connection_id, this->largest_acked_packet_number(),
+ std::move(buf), len, retransmittable);
break;
default:
if (this->_handshake_handler && this->_handshake_handler->is_completed()) {
packet = this->_packet_factory.create_server_protected_packet(this->_quic_connection_id, this->largest_acked_packet_number(),
std::move(buf), len, retransmittable);
} else {
- packet = this->_packet_factory.create_server_cleartext_packet(this->_quic_connection_id, this->largest_acked_packet_number(),
- std::move(buf), len, retransmittable);
+ packet = this->_packet_factory.create_handshake_packet(this->_quic_connection_id, this->largest_acked_packet_number(),
+ std::move(buf), len, retransmittable);
}
break;
}
diff --git a/iocore/net/quic/QUICDebugNames.cc b/iocore/net/quic/QUICDebugNames.cc
index dd750df..1b794c9 100644
--- a/iocore/net/quic/QUICDebugNames.cc
+++ b/iocore/net/quic/QUICDebugNames.cc
@@ -30,14 +30,12 @@ QUICDebugNames::packet_type(QUICPacketType type)
switch (type) {
case QUICPacketType::VERSION_NEGOTIATION:
return "VERSION_NEGOTIATION";
- case QUICPacketType::CLIENT_INITIAL:
- return "CLIENT_INITIAL";
- case QUICPacketType::SERVER_STATELESS_RETRY:
- return "SERVER_STATELESS_RETRY";
- case QUICPacketType::SERVER_CLEARTEXT:
- return "SERVER_CLEARTEXT";
- case QUICPacketType::CLIENT_CLEARTEXT:
- return "CLIENT_CLEARTEXT";
+ case QUICPacketType::INITIAL:
+ return "INITIAL";
+ case QUICPacketType::RETRY:
+ return "RETRY";
+ case QUICPacketType::HANDSHAKE:
+ return "HANDSHAKE";
case QUICPacketType::ZERO_RTT_PROTECTED:
return "ZERO_RTT_PROTECTED";
case QUICPacketType::PROTECTED:
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index 5c262c8..8214a15 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -108,7 +108,7 @@ QUICHandshake::start(const QUICPacket *initial_packet, QUICPacketFactory *packet
{
// Negotiate version
if (this->_version_negotiator->status() == QUICVersionNegotiationStatus::NOT_NEGOTIATED) {
- if (initial_packet->type() != QUICPacketType::CLIENT_INITIAL) {
+ if (initial_packet->type() != QUICPacketType::HANDSHAKE) {
return QUICErrorUPtr(new QUICConnectionError(QUICTransErrorCode::PROTOCOL_VIOLATION));
}
if (initial_packet->version()) {
diff --git a/iocore/net/quic/QUICLossDetector.cc b/iocore/net/quic/QUICLossDetector.cc
index ec19795..31cae5a 100644
--- a/iocore/net/quic/QUICLossDetector.cc
+++ b/iocore/net/quic/QUICLossDetector.cc
@@ -150,9 +150,9 @@ QUICLossDetector::on_packet_sent(QUICPacketUPtr packet)
bool is_handshake = false;
QUICPacketType type = packet->type();
+
// XXX: Should QUICPacketType::SERVER_STATELESS_RETRY be included?
- if (type == QUICPacketType::CLIENT_INITIAL || type == QUICPacketType::SERVER_CLEARTEXT ||
- type == QUICPacketType::CLIENT_CLEARTEXT) {
+ if (type == QUICPacketType::INITIAL || type == QUICPacketType::HANDSHAKE) {
is_handshake = true;
}
diff --git a/iocore/net/quic/QUICPacket.cc b/iocore/net/quic/QUICPacket.cc
index 048d3d2..3fbc20f 100644
--- a/iocore/net/quic/QUICPacket.cc
+++ b/iocore/net/quic/QUICPacket.cc
@@ -29,11 +29,15 @@ ClassAllocator<QUICPacket> quicPacketAllocator("quicPacketAllocator");
ClassAllocator<QUICPacketLongHeader> quicPacketLongHeaderAllocator("quicPacketLongHeaderAllocator");
ClassAllocator<QUICPacketShortHeader> quicPacketShortHeaderAllocator("quicPacketShortHeaderAllocator");
-static constexpr int OFFSET_CONNECTION_ID = 1;
-static constexpr int OFFSET_PACKET_NUMBER = 9;
-static constexpr int OFFSET_VERSION = 13;
-static constexpr int OFFSET_PAYLOAD = 17;
-static constexpr int LONGHEADER_LENGTH = 17;
+static constexpr int LONG_HDR_OFFSET_CONNECTION_ID = 1;
+static constexpr int LONG_HDR_OFFSET_VERSION = 9;
+static constexpr int LONG_HDR_OFFSET_PACKET_NUMBER = 13;
+static constexpr int LONG_HDR_OFFSET_PAYLOAD = 17;
+static constexpr int LONG_HDR_LENGTH = 17;
+
+static constexpr int SHORT_HDR_OFFSET_CONNECTION_ID = 1;
+
+static constexpr int VERSION_NEGOTIATION_PKT_HEADER_LENGTH = 13;
//
// QUICPacketHeader
@@ -126,11 +130,12 @@ QUICPacketType
QUICPacketLongHeader::type() const
{
if (this->_buf) {
- int type = this->_buf[0] & 0x7F;
- if (type < static_cast<int>(QUICPacketType::UNINITIALIZED)) {
- return static_cast<QUICPacketType>(type);
+ uint8_t type = this->_buf[0] & 0x7F;
+ if (this->version() == 0x00) {
+ return QUICPacketType::VERSION_NEGOTIATION;
} else {
- return QUICPacketType::UNINITIALIZED;
+ // any other version-specific type?
+ return static_cast<QUICPacketType>(type);
}
} else {
return this->_type;
@@ -141,7 +146,7 @@ QUICConnectionId
QUICPacketLongHeader::connection_id() const
{
if (this->_buf) {
- return QUICTypeUtil::read_QUICConnectionId(this->_buf + OFFSET_CONNECTION_ID, 8);
+ return QUICTypeUtil::read_QUICConnectionId(this->_buf + LONG_HDR_OFFSET_CONNECTION_ID, 8);
} else {
return this->_connection_id;
}
@@ -152,8 +157,8 @@ QUICPacketLongHeader::packet_number() const
{
if (this->_buf) {
const uint8_t packet_number_len = 4;
- QUICPacketNumber src = QUICTypeUtil::read_QUICPacketNumber(this->_buf + OFFSET_PACKET_NUMBER, packet_number_len);
- QUICPacketNumber dst = 0;
+ QUICPacketNumber src = QUICTypeUtil::read_QUICPacketNumber(this->_buf + LONG_HDR_OFFSET_PACKET_NUMBER, packet_number_len);
+ QUICPacketNumber dst = 0;
QUICPacket::decode_packet_number(dst, src, packet_number_len, this->_base_packet_number);
return dst;
@@ -172,7 +177,7 @@ QUICVersion
QUICPacketLongHeader::version() const
{
if (this->_buf) {
- return QUICTypeUtil::read_QUICVersion(this->_buf + OFFSET_VERSION);
+ return QUICTypeUtil::read_QUICVersion(this->_buf + LONG_HDR_OFFSET_VERSION);
} else {
return this->_version;
}
@@ -188,7 +193,7 @@ const uint8_t *
QUICPacketLongHeader::payload() const
{
if (this->_buf) {
- return this->_buf + OFFSET_PAYLOAD;
+ return this->_buf + LONG_HDR_OFFSET_PAYLOAD;
} else {
return this->_payload.get();
}
@@ -220,7 +225,11 @@ QUICPacketLongHeader::key_phase() const
uint16_t
QUICPacketLongHeader::size() const
{
- return LONGHEADER_LENGTH;
+ if (this->type() == QUICPacketType::VERSION_NEGOTIATION) {
+ return VERSION_NEGOTIATION_PKT_HEADER_LENGTH;
+ } else {
+ return LONG_HDR_LENGTH;
+ }
}
void
@@ -298,7 +307,7 @@ QUICPacketShortHeader::connection_id() const
{
if (this->_buf) {
ink_release_assert(this->has_connection_id());
- return QUICTypeUtil::read_QUICConnectionId(this->_buf + OFFSET_CONNECTION_ID, 8);
+ return QUICTypeUtil::read_QUICConnectionId(this->_buf + SHORT_HDR_OFFSET_CONNECTION_ID, 8);
} else {
return _connection_id;
}
@@ -309,9 +318,9 @@ QUICPacketShortHeader::packet_number() const
{
if (this->_buf) {
int n = this->_packet_number_len();
- int offset = 1;
+ int offset = SHORT_HDR_OFFSET_CONNECTION_ID;
if (this->has_connection_id()) {
- offset = OFFSET_PACKET_NUMBER;
+ offset += 8;
}
QUICPacketNumber src = QUICTypeUtil::read_QUICPacketNumber(this->_buf + offset, n);
@@ -654,9 +663,8 @@ QUICPacketFactory::create(ats_unique_buf buf, size_t len, QUICPacketNumber base_
result = QUICPacketCreationResult::NOT_READY;
}
break;
- case QUICPacketType::CLIENT_INITIAL:
- case QUICPacketType::CLIENT_CLEARTEXT:
- case QUICPacketType::SERVER_CLEARTEXT:
+ case QUICPacketType::INITIAL:
+ case QUICPacketType::HANDSHAKE:
if (this->_crypto->decrypt(plain_txt.get(), plain_txt_len, max_plain_txt_len, header->payload(), header->payload_size(),
header->packet_number(), header->buf(), header->size(), QUICKeyPhase::CLEARTEXT)) {
result = QUICPacketCreationResult::SUCCESS;
@@ -698,12 +706,21 @@ QUICPacketFactory::create_version_negotiation_packet(const QUICPacket *packet_se
}
QUICPacketUPtr
-QUICPacketFactory::create_server_cleartext_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number,
- ats_unique_buf payload, size_t len, bool retransmittable)
+QUICPacketFactory::create_initial_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number, QUICVersion version,
+ ats_unique_buf payload, size_t len)
+{
+ QUICPacketHeader *header = QUICPacketHeader::build(QUICPacketType::INITIAL, connection_id, this->_packet_number_generator.next(),
+ base_packet_number, version, std::move(payload), len);
+ return this->_create_encrypted_packet(header, true);
+}
+
+QUICPacketUPtr
+QUICPacketFactory::create_handshake_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number,
+ ats_unique_buf payload, size_t len, bool retransmittable)
{
QUICPacketHeader *header =
- QUICPacketHeader::build(QUICPacketType::SERVER_CLEARTEXT, connection_id, this->_packet_number_generator.next(),
- base_packet_number, this->_version, std::move(payload), len);
+ QUICPacketHeader::build(QUICPacketType::HANDSHAKE, connection_id, this->_packet_number_generator.next(), base_packet_number,
+ this->_version, std::move(payload), len);
return this->_create_encrypted_packet(header, retransmittable);
}
@@ -719,16 +736,6 @@ QUICPacketFactory::create_server_protected_packet(QUICConnectionId connection_id
}
QUICPacketUPtr
-QUICPacketFactory::create_client_initial_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number,
- QUICVersion version, ats_unique_buf payload, size_t len)
-{
- QUICPacketHeader *header =
- QUICPacketHeader::build(QUICPacketType::CLIENT_INITIAL, connection_id, this->_packet_number_generator.next(),
- base_packet_number, version, std::move(payload), len);
- return this->_create_encrypted_packet(header, true);
-}
-
-QUICPacketUPtr
QUICPacketFactory::create_stateless_reset_packet(QUICConnectionId connection_id, QUICStatelessResetToken stateless_reset_token)
{
std::random_device rnd;
diff --git a/iocore/net/quic/QUICPacket.h b/iocore/net/quic/QUICPacket.h
index 79b82cf..5f5d4f7 100644
--- a/iocore/net/quic/QUICPacket.h
+++ b/iocore/net/quic/QUICPacket.h
@@ -295,12 +295,12 @@ public:
QUICPacketUPtr create(ats_unique_buf buf, size_t len, QUICPacketNumber base_packet_number, QUICPacketCreationResult &result);
QUICPacketUPtr create_version_negotiation_packet(const QUICPacket *packet_sent_by_client, QUICPacketNumber base_packet_number);
- QUICPacketUPtr create_server_cleartext_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number,
- ats_unique_buf payload, size_t len, bool retransmittable);
+ QUICPacketUPtr create_initial_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number, QUICVersion version,
+ ats_unique_buf payload, size_t len);
+ QUICPacketUPtr create_handshake_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number,
+ ats_unique_buf payload, size_t len, bool retransmittable);
QUICPacketUPtr create_server_protected_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number,
ats_unique_buf payload, size_t len, bool retransmittable);
- QUICPacketUPtr create_client_initial_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number,
- QUICVersion version, ats_unique_buf payload, size_t len);
static QUICPacketUPtr create_stateless_reset_packet(QUICConnectionId connection_id,
QUICStatelessResetToken stateless_reset_token);
void set_version(QUICVersion negotiated_version);
diff --git a/iocore/net/quic/QUICTypes.h b/iocore/net/quic/QUICTypes.h
index 6757d70..09557e8 100644
--- a/iocore/net/quic/QUICTypes.h
+++ b/iocore/net/quic/QUICTypes.h
@@ -62,16 +62,16 @@ constexpr QUICVersion QUIC_SUPPORTED_VERSIONS[] = {
};
constexpr QUICStreamId STREAM_ID_FOR_HANDSHAKE = 0;
-enum class QUICPacketType : int {
- VERSION_NEGOTIATION = 1,
- CLIENT_INITIAL,
- SERVER_STATELESS_RETRY,
- SERVER_CLEARTEXT,
- CLIENT_CLEARTEXT,
- ZERO_RTT_PROTECTED,
- PROTECTED, // Not on the spec. but just for convenience
- STATELESS_RESET, // Not on the spec. but just for convenience
- UNINITIALIZED, // Not on the spec. but just for convenience
+// Devide to QUICPacketType and QUICPacketLongHeaderType ?
+enum class QUICPacketType : uint8_t {
+ VERSION_NEGOTIATION = 0,
+ PROTECTED, // Not on the spec. but just for convenience // should be short header
+ STATELESS_RESET, // Not on the spec. but just for convenience
+ INITIAL = 0x7F, // draft-08 version-specific type
+ RETRY = 0x7E, // draft-08 version-specific type
+ HANDSHAKE = 0x7D, // draft-08 version-specific type
+ ZERO_RTT_PROTECTED = 0x7C, // draft-08 version-specific type
+ UNINITIALIZED = 0xFF, // Not on the spec. but just for convenience
};
// To detect length of Packet Number
diff --git a/iocore/net/quic/test/test_QUICLossDetector.cc b/iocore/net/quic/test/test_QUICLossDetector.cc
index 4284182..af39c41 100644
--- a/iocore/net/quic/test/test_QUICLossDetector.cc
+++ b/iocore/net/quic/test/test_QUICLossDetector.cc
@@ -40,8 +40,8 @@ TEST_CASE("QUICLossDetector_Loss_in_Handshake", "[quic]")
ats_unique_buf payload = ats_unique_malloc(sizeof(raw));
memcpy(payload.get(), raw, sizeof(raw));
- QUICPacketHeader *header = QUICPacketHeader::build(QUICPacketType::SERVER_CLEARTEXT, 0xffddbb9977553311ULL, 0x00000001, 0,
- 0x00112233, std::move(payload), sizeof(raw));
+ QUICPacketHeader *header = QUICPacketHeader::build(QUICPacketType::HANDSHAKE, 0xffddbb9977553311ULL, 0x00000001, 0, 0x00112233,
+ std::move(payload), sizeof(raw));
QUICPacketUPtr packet =
QUICPacketUPtr(new QUICPacket(header, std::move(payload), sizeof(raw), true), [](QUICPacket *p) { delete p; });
detector.on_packet_sent(std::move(packet));
diff --git a/iocore/net/quic/test/test_QUICPacket.cc b/iocore/net/quic/test/test_QUICPacket.cc
index 8a39c57..ee25cb0 100644
--- a/iocore/net/quic/test/test_QUICPacket.cc
+++ b/iocore/net/quic/test/test_QUICPacket.cc
@@ -27,20 +27,41 @@
TEST_CASE("QUICPacketHeader", "[quic]")
{
+ SECTION("Long Header (load) Version Negotiation Packet")
+ {
+ const uint8_t input[] = {
+ 0x80, // Long header, Type: NONE
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, // Connection ID
+ 0x00, 0x00, 0x00, 0x00, // Version
+ 0x00, 0x00, 0x00, 0x08, // Supported Version 1
+ 0x00, 0x00, 0x00, 0x09, // Supported Version 1
+ };
+
+ QUICPacketHeader *header = QUICPacketHeader::load(input, sizeof(input), 0);
+ CHECK(header->size() == 13);
+ CHECK(header->packet_size() == 21);
+ CHECK(header->type() == QUICPacketType::VERSION_NEGOTIATION);
+ CHECK(header->has_connection_id() == true);
+ CHECK(header->connection_id() == 0x0102030405060708);
+ CHECK(header->has_version() == true);
+ CHECK(header->version() == 0x00000000);
+ CHECK(header->has_key_phase() == false);
+ }
+
SECTION("Long Header (load)")
{
const uint8_t input[] = {
- 0x81, // Long header, Type
+ 0xFF, // Long header, Type: INITIAL
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, // Connection ID
- 0x12, 0x34, 0x56, 0x78, // Packet number
0x11, 0x22, 0x33, 0x44, // Version
+ 0x12, 0x34, 0x56, 0x78, // Packet number
0xff, 0xff, // Payload (dummy)
};
QUICPacketHeader *header = QUICPacketHeader::load(input, sizeof(input), 0);
CHECK(header->size() == 17);
CHECK(header->packet_size() == 19);
- CHECK(header->type() == QUICPacketType::VERSION_NEGOTIATION);
+ CHECK(header->type() == QUICPacketType::INITIAL);
CHECK(header->has_connection_id() == true);
CHECK(header->connection_id() == 0x0102030405060708);
CHECK(header->packet_number() == 0x12345678);
@@ -55,13 +76,13 @@ TEST_CASE("QUICPacketHeader", "[quic]")
ats_unique_buf payload = ats_unique_malloc(sizeof(expected));
memcpy(payload.get(), expected, sizeof(expected));
- QUICPacketHeader *header = QUICPacketHeader::build(QUICPacketType::CLIENT_INITIAL, 0x0102030405060708, 0x12345678, 0,
- 0xa0a0a0a0, std::move(payload), 32);
+ QUICPacketHeader *header =
+ QUICPacketHeader::build(QUICPacketType::INITIAL, 0x0102030405060708, 0x12345678, 0, 0xa0a0a0a0, std::move(payload), 32);
CHECK(header->size() == 17);
CHECK(header->has_key_phase() == false);
CHECK(header->packet_size() == 0);
- CHECK(header->type() == QUICPacketType::CLIENT_INITIAL);
+ CHECK(header->type() == QUICPacketType::INITIAL);
CHECK(header->has_connection_id() == true);
CHECK(header->connection_id() == 0x0102030405060708);
CHECK(header->packet_number() == 0x12345678);
@@ -110,14 +131,6 @@ TEST_CASE("QUICPacketHeader", "[quic]")
}
}
-TEST_CASE("Loading Unknown Packet", "[quic]")
-{
- const uint8_t buf[] = {0xff};
- QUICPacketHeader *header = QUICPacketHeader::load(buf, sizeof(buf), 0);
-
- CHECK(header->type() == QUICPacketType::UNINITIALIZED);
-}
-
TEST_CASE("Encoded Packet Number Length", "[quic]")
{
QUICPacketNumber base = 0x6afa2f;
diff --git a/iocore/net/quic/test/test_QUICPacketFactory.cc b/iocore/net/quic/test/test_QUICPacketFactory.cc
index f5fcf15..9f22800 100644
--- a/iocore/net/quic/test/test_QUICPacketFactory.cc
+++ b/iocore/net/quic/test/test_QUICPacketFactory.cc
@@ -53,7 +53,7 @@ TEST_CASE("QUICPacketFactory_Create_VersionNegotiationPacket", "[quic]")
CHECK(memcmp(packet->payload(), "\xff\x00\x00\x07", 4) == 0);
}
-TEST_CASE("QUICPacketFactory_Create_ServerCleartextPacket", "[quic]")
+TEST_CASE("QUICPacketFactory_Create_Handshake", "[quic]")
{
QUICPacketFactory factory;
MockQUICCrypto crypto;
@@ -64,8 +64,8 @@ TEST_CASE("QUICPacketFactory_Create_ServerCleartextPacket", "[quic]")
ats_unique_buf payload = ats_unique_malloc(sizeof(raw));
memcpy(payload.get(), raw, sizeof(raw));
- QUICPacketUPtr packet = factory.create_server_cleartext_packet(0x01020304, 0, std::move(payload), sizeof(raw), true);
- CHECK(packet->type() == QUICPacketType::SERVER_CLEARTEXT);
+ QUICPacketUPtr packet = factory.create_handshake_packet(0x01020304, 0, std::move(payload), sizeof(raw), true);
+ CHECK(packet->type() == QUICPacketType::HANDSHAKE);
CHECK(packet->connection_id() == 0x01020304);
CHECK(memcmp(packet->payload(), raw, sizeof(raw)) == 0);
CHECK((packet->packet_number() & 0xFFFFFFFF80000000) == 0);
diff --git a/iocore/net/quic/test/test_QUICVersionNegotiator.cc b/iocore/net/quic/test/test_QUICVersionNegotiator.cc
index c8c0a93..c4b3444 100644
--- a/iocore/net/quic/test/test_QUICVersionNegotiator.cc
+++ b/iocore/net/quic/test/test_QUICVersionNegotiator.cc
@@ -37,8 +37,7 @@ TEST_CASE("QUICVersionNegotiator_Normal", "[quic]")
CHECK(vn.status() == QUICVersionNegotiationStatus::NOT_NEGOTIATED);
// Negotiate version
- QUICPacketUPtr initial_packet =
- packet_factory.create_client_initial_packet({}, 0, QUIC_SUPPORTED_VERSIONS[0], ats_unique_malloc(0), 0);
+ QUICPacketUPtr initial_packet = packet_factory.create_initial_packet({}, 0, QUIC_SUPPORTED_VERSIONS[0], ats_unique_malloc(0), 0);
vn.negotiate(initial_packet.get());
CHECK(vn.status() == QUICVersionNegotiationStatus::NEGOTIATED);
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.