Add LengthPrefixedConnectionId support to QuicDataReader and Writer
This is currently only used in v99 NEW_CONNECTION_ID frames but will soon be used to parse the new connection ID invariants
gfe-relnote: n/a, protected by disabled v99 flag
PiperOrigin-RevId: 258684056
Change-Id: I666d150b9392e195a073272d2c5e79bd970d5862
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc
index 690e911..d73c412 100644
--- a/quic/core/quic_framer_test.cc
+++ b/quic/core/quic_framer_test.cc
@@ -16,6 +16,7 @@
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
+#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
@@ -11293,7 +11294,7 @@
{kVarInt62OneByte + 0x11}},
{"Unable to read new connection ID frame retire_prior_to.",
{kVarInt62OneByte + 0x09}},
- {"Unable to read new connection ID frame connection id length.",
+ {"Unable to read new connection ID frame connection id.",
{0x08}}, // connection ID length
{"Unable to read new connection ID frame connection id.",
{0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x11}},
@@ -11352,7 +11353,7 @@
{kVarInt62OneByte + 0x11}},
{"Unable to read new connection ID frame retire_prior_to.",
{kVarInt62OneByte + 0x0a}},
- {"Unable to read new connection ID frame connection id length.",
+ {"Unable to read new connection ID frame connection id.",
{0x09}}, // connection ID length
{"Unable to read new connection ID frame connection id.",
{0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10, 0x42}},
@@ -11413,7 +11414,7 @@
{kVarInt62OneByte + 0x11}},
{"Unable to read new connection ID frame retire_prior_to.",
{kVarInt62OneByte + 0x0b}},
- {"Unable to read new connection ID frame connection id length.",
+ {"Unable to read new connection ID frame connection id.",
{0x13}}, // connection ID length
{"Unable to read new connection ID frame connection id.",
{0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
@@ -11429,7 +11430,8 @@
AssemblePacketFromFragments(packet99));
EXPECT_FALSE(framer_.ProcessPacket(*encrypted));
EXPECT_EQ(QUIC_INVALID_NEW_CONNECTION_ID_DATA, framer_.error());
- EXPECT_EQ("New connection ID length too high.", framer_.detailed_error());
+ EXPECT_EQ("Unable to read new connection ID frame connection id.",
+ framer_.detailed_error());
}
// Verifies that parsing a NEW_CONNECTION_ID frame with an invalid