Remove version check for header parsing all together
#include <stdlib.h>
#include <string.h>
-int picoquic_is_header_version_supported(uint32_t version)
-{
- int ret = 0; /* return 1 if version is supported */
-
- if ((version & 0xFFFF0000) == 0) {
- /* Final versions (0x0001-0xFFFF) and version negotiation (0x0) */
- ret = 1;
- } else if ((version & 0xFFFFFF00) == 0xFF000000 && (version & 0xFF) > 20) {
- /* Draft versions before #20 use the old invariants */
- ret = 1;
- } else if ((version & 0x0F0F0F0F) == 0x0A0A0A0A) {
- /* version greasing, i.e. force version negotiation */
- ret = 1;
- } else if (
- version == PICOQUIC_INTERNAL_TEST_VERSION_1 ||
- version == PICOQUIC_INTERNAL_TEST_VERSION_2) {
- /* Internal versions use the new invariants */
- ret = 1;
- }
-
- return ret;
-}
-
int picoquic_parse_long_packet_header(
picoquic_quic_t* quic,
uint8_t* bytes,
@@ -74,10 +51,6 @@ int picoquic_parse_long_packet_header(
else {
/* The bytes at position 1..4 describe the version */
ph->vn = PICOPARSE_32(bytes + 1);
- if (!picoquic_is_header_version_supported(ph->vn)) {
- ret = -1;
- }
- else {
uint8_t l_dest_id = 0;
uint8_t l_srce_id = 0;
uint32_t i_srce_id = 0;
@@ -264,7 +237,6 @@ int picoquic_parse_long_packet_header(
}
}
}
- }
return ret;
}
