Commit a4764246 authored by jan.koester's avatar jan.koester
Browse files

bugfix

parent 65f83dcd
Loading
Loading
Loading
Loading
+14 −1
Changes for src/quic.cpp: 14 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2137,8 +2137,21 @@ void quic::processIncomingPacket(const uint8_t* data, size_t len) {
            }
            pkt_offset += scid_len;

            // For Initial packets, skip token
            // Retry packets have a completely different tail layout than
            // every other long-header type: a raw Token (no length prefix)
            // followed by a 16-byte Integrity Tag, running to the end of
            // the datagram — no Length field, no packet number, and never
            // coalesced with anything else. Treating the rest of the loop
            // below's Length-field parsing as applicable to a Retry would
            // misinterpret Token/tag bytes as a bogus length, truncating
            // the packet handed to processLongHeaderPacket().
            uint8_t packet_type = (data[offset] & 0x30) >> 4;
            if (packet_type == 0x03) {  // Retry
                processLongHeaderPacket(data + offset, len - offset);
                break;
            }

            // For Initial packets, skip token
            if (packet_type == 0x00) {  // Initial
                size_t tok_bytes;
                uint64_t tok_len = decodeVarInt(&data[pkt_offset], len - pkt_offset, tok_bytes);