static const QUIC_PKT_HDR rx_script_1_expect_hdr = {
QUIC_PKT_TYPE_INITIAL,
- 0, 0, 2, 0, 1, 0, 1, { 0, {0} },
+ 0, 0, 2, 0, 1, 0, 0, 1, { 0, {0} },
{ 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } },
{ 0, 1, 0, 0 },
NULL, 0,
static const QUIC_PKT_HDR rx_script_2_expect_hdr = {
QUIC_PKT_TYPE_1RTT,
- 0, 0, 3, 0, 1, 0, 0, {0, {0}}, {0, {0}},
+ 0, 0, 3, 0, 1, 0, 0, 0, {0, {0}}, {0, {0}},
{0x00, 0xbf, 0xf4, 0x00},
NULL, 0,
1, NULL
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{12, {0x35, 0x3c, 0x1b, 0x97, 0xca, 0xf8, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
1, /* Version */
{0, {0}}, /* DCID */
{4, {0xad, 0x15, 0x3f, 0xae}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
1, /* Version */
{0, {0}}, /* DCID */
{4, {0x83, 0xd0, 0x0a, 0x27}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
1, /* Version */
{0, {0}}, /* DCID */
{4, {0x83, 0xd0, 0x0a, 0x27}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{0, {0}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
1, /* Version */
{0, {0}}, /* DCID */
{4, {0x36, 0xf4, 0x75, 0x2d}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
1, /* Version */
{0, {0}}, /* DCID */
{4, {0x36, 0xf4, 0x75, 0x2d}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{0, {0}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
1, /* Version */
{0, {0}}, /* DCID */
{4, {0x03, 0x45, 0x0c, 0x7a}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
1, /* Version */
{0, {0}}, /* DCID */
{4, {0x03, 0x45, 0x0c, 0x7a}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{0, {0}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{0, {0}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{0, {0}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{0, {0}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{0, {0}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{0, {0}}, /* SCID */
0, /* Partial */
1, /* Fixed */
0, /* Unused */
+ 0, /* Reserved */
0, /* Version */
{0, {0}}, /* DCID */
{0, {0}}, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{ 0, {0} }, /* DCID */
{ 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{ 0, {0} }, /* DCID */
{ 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 0, {0} }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 0, {0} }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 0, {0} }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 0, {0} }, /* SCID */
0, /* partial */
1, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 2, {0x81, 0x82} }, /* SCID */
0, /* partial */
0, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 3, {0x70, 0x71, 0x72} }, /* DCID */
{ 2, {0x81, 0x82} }, /* SCID */
19, 23
};
+/* Packet Header Test 17: Initial - Non-Zero Reserved Bits */
+static const unsigned char pkt_hdr_test_17_expected[] = {
+ 0xcd, /* Long|Fixed, Type=Initial, PN Len=2 */
+ 0x00, 0x00, 0x00, 0x01, /* Version */
+ 0x00, /* DCID Length */
+ 0x08, 0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5, /* SCID Length, SCID */
+ 0x00, /* Token Length */
+ 0x15, /* Length=21 */
+ 0x33, 0x44, /* Encoded PN */
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* Payload */
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22
+};
+
+static const unsigned char pkt_hdr_test_17_payload[] = {
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22
+};
+
+static const struct pkt_hdr_test pkt_hdr_test_17 = {
+ {
+ QUIC_PKT_TYPE_INITIAL, /* type */
+ 0, /* spin bit */
+ 0, /* key phase */
+ 2, /* PN length */
+ 0, /* partial */
+ 1, /* fixed */
+ 0, /* unused */
+ 3, /* reserved */
+ 1, /* version */
+ { 0, {0} }, /* DCID */
+ { 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
+ { 0x33, 0x44 }, /* PN */
+ NULL, 0, /* Token/Token Len */
+ 19, NULL /* Len/Data */
+ },
+ pkt_hdr_test_17_expected, OSSL_NELEM(pkt_hdr_test_17_expected),
+ pkt_hdr_test_17_payload, OSSL_NELEM(pkt_hdr_test_17_payload),
+ 0, sizeof(pkt_hdr_test_17_expected),
+ 17, 21
+};
+
+/* Packet Header Test 18: 0-RTT - Non-Zero Reserved Bits */
+static const unsigned char pkt_hdr_test_18_expected[] = {
+ 0xd8, /* Long|Fixed, Type=0-RTT, PN Len=1 */
+ 0x00, 0x00, 0x00, 0x01, /* Version */
+ 0x03, /* DCID Length */
+ 0x70, 0x71, 0x72, /* DCID */
+ 0x08, 0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5, /* SCID Length, SCID */
+ 0x14, /* Length=20 */
+ 0x33, /* Encoded PN */
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* Payload */
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22
+};
+
+static const unsigned char pkt_hdr_test_18_payload[] = {
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22
+};
+
+static const struct pkt_hdr_test pkt_hdr_test_18 = {
+ {
+ QUIC_PKT_TYPE_0RTT, /* type */
+ 0, /* spin bit */
+ 0, /* key phase */
+ 1, /* PN length */
+ 0, /* partial */
+ 1, /* fixed */
+ 0, /* unused */
+ 2, /* reserved */
+ 1, /* version */
+ { 3, {0x70, 0x71, 0x72} }, /* DCID */
+ { 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
+ { 0x33 }, /* PN */
+ NULL, 0, /* Token */
+ 19, NULL /* Len/Data */
+ },
+ pkt_hdr_test_18_expected, OSSL_NELEM(pkt_hdr_test_18_expected),
+ pkt_hdr_test_18_payload, OSSL_NELEM(pkt_hdr_test_18_payload),
+ 0, sizeof(pkt_hdr_test_18_expected),
+ 19, 23
+};
+
+/* Packet Header Test 19: Handshake - Non-Zero Reserved Bits */
+static const unsigned char pkt_hdr_test_19_expected[] = {
+ 0xe4, /* Long|Fixed, Type=Handshake, PN Len=1 */
+ 0x00, 0x00, 0x00, 0x01, /* Version */
+ 0x03, /* DCID Length */
+ 0x70, 0x71, 0x72, /* DCID */
+ 0x08, 0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5, /* SCID Length, SCID */
+ 0x14, /* Length=20 */
+ 0x33, /* Encoded PN */
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* Payload */
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22
+};
+
+static const unsigned char pkt_hdr_test_19_payload[] = {
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22
+};
+
+static const struct pkt_hdr_test pkt_hdr_test_19 = {
+ {
+ QUIC_PKT_TYPE_HANDSHAKE, /* type */
+ 0, /* spin bit */
+ 0, /* key phase */
+ 1, /* PN length */
+ 0, /* partial */
+ 1, /* fixed */
+ 0, /* unused */
+ 1, /* reserved */
+ 1, /* version */
+ { 3, {0x70, 0x71, 0x72} }, /* DCID */
+ { 8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5 } }, /* SCID */
+ { 0x33 }, /* PN */
+ NULL, 0, /* Token */
+ 19, NULL /* Len/Data */
+ },
+ pkt_hdr_test_19_expected, OSSL_NELEM(pkt_hdr_test_19_expected),
+ pkt_hdr_test_19_payload, OSSL_NELEM(pkt_hdr_test_19_payload),
+ 0, sizeof(pkt_hdr_test_19_expected),
+ 19, 23
+};
+
+/* Packet Header Test 20: 1-RTT with Non-Zero Reserved Bits */
+static const unsigned char pkt_hdr_test_20_expected[] = {
+ 0x5a, /* Short|Fixed, Type=1-RTT, PN Len=3 */
+ 0x70, 0x71, 0x72, /* DCID */
+ 0x50, 0x51, 0x52, /* PN */
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+ 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1
+};
+
+static const unsigned char pkt_hdr_test_20_payload[] = {
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+ 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1
+};
+
+static const struct pkt_hdr_test pkt_hdr_test_20 = {
+ {
+ QUIC_PKT_TYPE_1RTT, /* type */
+ 0, /* spin bit */
+ 0, /* key phase */
+ 3, /* PN length */
+ 0, /* partial */
+ 1, /* fixed */
+ 0, /* unused */
+ 3, /* reserved */
+ 0, /* version */
+ { 3, {0x70, 0x71, 0x72} }, /* DCID */
+ { 0, {0} }, /* SCID */
+ { 0x50, 0x51, 0x52 }, /* PN */
+ NULL, 0, /* Token */
+ 18, NULL /* Len/Data */
+ },
+ pkt_hdr_test_20_expected, OSSL_NELEM(pkt_hdr_test_20_expected),
+ pkt_hdr_test_20_payload, OSSL_NELEM(pkt_hdr_test_20_payload),
+ 3, 21,
+ 4, 8
+};
+
static const struct pkt_hdr_test *const pkt_hdr_tests[] = {
&pkt_hdr_test_1,
&pkt_hdr_test_2,
&pkt_hdr_test_13,
&pkt_hdr_test_14,
&pkt_hdr_test_15,
- &pkt_hdr_test_16
+ &pkt_hdr_test_16,
+ &pkt_hdr_test_17,
+ &pkt_hdr_test_18,
+ &pkt_hdr_test_19,
+ &pkt_hdr_test_20
};
#define HPR_REPEAT_COUNT 4
0, /* partial */
0, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{8, {0x83, 0x94, 0xc8, 0xf0, 0x3e, 0x51, 0x57, 0x08}}, /* DCID */
{ 0, {0} }, /* SCID */
0, /* partial */
0, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{ 0, {0} }, /* DCID */
{8, {0xf0, 0x67, 0xa5, 0x50, 0x2a, 0x42, 0x62, 0xb5}}, /* SCID */
0, /* partial */
0, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 0, {0} }, /* DCID */
{ 0, {0} }, /* SCID */
0, /* partial */
0, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 4, {0x6e, 0x4e, 0xbd, 0x49} }, /* DCID */
{ 0, {0} }, /* SCID */
0, /* partial */
0, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 4, {0x6e, 0x4e, 0xbd, 0x49} }, /* DCID */
{ 0, {0} }, /* SCID */
0, /* partial */
0, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 4, {0x6e, 0x4e, 0xbd, 0x49} }, /* DCID */
{ 0, {0} }, /* SCID */
0, /* partial */
0, /* fixed */
0, /* unused */
+ 0, /* reserved */
1, /* version */
{ 0, {0} }, /* DCID */
{ 4, {0xa9, 0x20, 0xcc, 0xc2} }, /* SCID */
0, /* partial */
0, /* fixed */
0, /* unused */
+ 0, /* reserved */
0, /* version */
{ 0, {0} }, /* DCID */
{ 12, {0x35, 0x3c, 0x1b, 0x97, 0xca, 0xf8, 0x99,