diff --git a/.travis.yml b/.travis.yml index b251f496b07fdca4df01d3c719c312d5df3c0794..896c00597bb40db8fffa2e56d3dc40f338314d17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ script: - cmake . - make - ulimit -c unlimited -S - - ./picoquic_ct && RESULT=$? + - ./picoquic_ct -x fuzz && RESULT=$? # Early out if the program exited successfully - if [[ ${RESULT} == 0 ]]; then exit 0; fi; - for i in $(find ./ -maxdepth 1 -name 'core*' -print); do gdb $(pwd)/picoquic_ct core* -ex "thread apply all bt" -ex "set pagination 0" -batch; done; diff --git a/picoquic/logger.c b/picoquic/logger.c index e2a74c2ea1d1b20fdae390852d96d664c589d56d..26fbfac39846366a0a1ab53400af8850d7db7ff8 100644 --- a/picoquic/logger.c +++ b/picoquic/logger.c @@ -403,13 +403,7 @@ void picoquic_log_retry_packet(FILE* F, uint64_t log_cnxid64, uint8_t unused_cil; int payload_length = (int)(length - ph->offset); - if (ph->vn == PICOQUIC_SEVENTH_INTEROP_VERSION) { - odcil = bytes[byte_index++]; - unused_cil = 0; - } - else { - picoquic_parse_packet_header_cnxid_lengths(bytes[byte_index++], &unused_cil, &odcil); - } + picoquic_parse_packet_header_cnxid_lengths(bytes[byte_index++], &unused_cil, &odcil); if (unused_cil != 0) { /* malformed ODCIL, or does not match initial cid; ignore */ diff --git a/picoquic/packet.c b/picoquic/packet.c index c60b5588368d2f88f753a02f47de72247b4d4dc5..9e5d9aff64e90d9634c0537450724f7e467286d3 100644 --- a/picoquic/packet.c +++ b/picoquic/packet.c @@ -716,15 +716,10 @@ void picoquic_queue_stateless_retry(picoquic_cnx_t* cnx, byte_index = header_length = picoquic_create_packet_header(cnx, picoquic_packet_retry, 0, bytes, &pn_offset, &pn_length); - /* Draft 13 requires adding the ODCID, no frames */ - if (picoquic_supported_versions[cnx->version_index].version == - PICOQUIC_SEVENTH_INTEROP_VERSION) { - /* Old: encode ocdil as single byte */ - bytes[byte_index++] = cnx->initial_cnxid.id_len; - } else { - /* new: use same encoding as packet header */ - bytes[byte_index++] = picoquic_create_packet_header_cnxid_lengths(0, cnx->initial_cnxid.id_len); - } + + /* use same encoding as packet header */ + bytes[byte_index++] = picoquic_create_packet_header_cnxid_lengths(0, cnx->initial_cnxid.id_len); + byte_index += picoquic_format_connection_id(bytes + byte_index, PICOQUIC_MAX_PACKET_SIZE - byte_index - checksum_length, cnx->initial_cnxid); byte_index += (uint32_t)data_bytes; @@ -871,13 +866,8 @@ int picoquic_incoming_retry( uint8_t odcil; uint8_t unused_cil; - if (ph->vn == PICOQUIC_SEVENTH_INTEROP_VERSION) { - odcil = bytes[byte_index++]; - unused_cil = 0; - } - else { - picoquic_parse_packet_header_cnxid_lengths(bytes[byte_index++], &unused_cil, &odcil); - } + picoquic_parse_packet_header_cnxid_lengths(bytes[byte_index++], &unused_cil, &odcil); + if (unused_cil != 0 || odcil != cnx->initial_cnxid.id_len || odcil + 1 > ph->payload_length || memcmp(cnx->initial_cnxid.id, &bytes[byte_index], odcil) != 0) {