From 10e0dad8a4b6ea1e57492ee828b3506f5bf9d388 Mon Sep 17 00:00:00 2001 From: George Wang Date: Wed, 17 Mar 2021 12:58:22 -0400 Subject: [PATCH] Release 2.29.5 - Fix a few issues detected by h3spec for better compliance with HTTP/3 standard. --- CHANGELOG | 5 ++++ docs/conf.py | 2 +- include/lsquic.h | 2 +- src/liblsquic/lsquic_full_conn_ietf.c | 33 +++++++++++++++++++-------- src/liblsquic/lsquic_qdec_hdl.c | 2 +- src/liblsquic/lsquic_trans_params.c | 2 +- src/liblsquic/lsquic_trans_params.h | 3 +++ 7 files changed, 35 insertions(+), 14 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 90693cd..bff5e0c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +2021-03-17 + - 2.29.5 + - Fix a few issues detected by h3spec for better compliance with HTTP/3 + standard. + 2021-03-08 - 2.29.4 - [BUGFIX] Infinite loop in stream: returned HQ frame can be at any diff --git a/docs/conf.py b/docs/conf.py index 6c942f3..df74224 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ author = u'LiteSpeed Technologies' # The short X.Y version version = u'2.29' # The full version, including alpha/beta/rc tags -release = u'2.29.4' +release = u'2.29.5' # -- General configuration --------------------------------------------------- diff --git a/include/lsquic.h b/include/lsquic.h index 164ff7c..29b4a5e 100644 --- a/include/lsquic.h +++ b/include/lsquic.h @@ -25,7 +25,7 @@ extern "C" { #define LSQUIC_MAJOR_VERSION 2 #define LSQUIC_MINOR_VERSION 29 -#define LSQUIC_PATCH_VERSION 4 +#define LSQUIC_PATCH_VERSION 5 /** * Engine flags: diff --git a/src/liblsquic/lsquic_full_conn_ietf.c b/src/liblsquic/lsquic_full_conn_ietf.c index 4d5d2aa..9ee2bb3 100644 --- a/src/liblsquic/lsquic_full_conn_ietf.c +++ b/src/liblsquic/lsquic_full_conn_ietf.c @@ -6393,6 +6393,13 @@ process_new_token_frame (struct ietf_full_conn *conn, return 0; } + if (conn->ifc_flags & IFC_SERVER) + { /* [draft-ietf-quic-transport-34] Section 19.7 */ + ABORT_QUIETLY(0, TEC_PROTOCOL_VIOLATION, + "received unexpected NEW_TOKEN frame"); + return 0; + } + if (LSQ_LOG_ENABLED(LSQ_LOG_DEBUG) || LSQ_LOG_ENABLED_EXT(LSQ_LOG_DEBUG, LSQLM_EVENT)) { @@ -6858,17 +6865,22 @@ parse_regular_packet (struct ietf_full_conn *conn, p = packet_in->pi_data + packet_in->pi_header_sz; pend = packet_in->pi_data + packet_in->pi_data_sz; - while (p < pend) - { - len = process_packet_frame(conn, packet_in, p, pend - p); - if (len > 0) - p += len; - else + if (p < pend) + do { - ABORT_ERROR("Error parsing frame"); - break; + len = process_packet_frame(conn, packet_in, p, pend - p); + if (len > 0) + p += len; + else + { + ABORT_ERROR("Error parsing frame"); + break; + } } - } + while (p < pend); + else + ABORT_QUIETLY(0, TEC_PROTOCOL_VIOLATION, + "packet %"PRIu64" has no frames", packet_in->pi_packno); } @@ -8959,7 +8971,8 @@ on_settings_frame (void *ctx) LSQ_DEBUG("SETTINGS frame"); if (conn->ifc_flags & IFC_HAVE_PEER_SET) { - ABORT_WARN("second incoming SETTING frame on HTTP control stream"); + ABORT_QUIETLY(1, HEC_FRAME_UNEXPECTED, + "second incoming SETTING frame on HTTP control stream"); return; } diff --git a/src/liblsquic/lsquic_qdec_hdl.c b/src/liblsquic/lsquic_qdec_hdl.c index 0dda8e0..87fb1b7 100644 --- a/src/liblsquic/lsquic_qdec_hdl.c +++ b/src/liblsquic/lsquic_qdec_hdl.c @@ -380,7 +380,7 @@ qdh_read_encoder_stream (void *ctx, const unsigned char *buf, size_t sz, LSQ_INFO("error reading encoder stream"); qerr = lsqpack_dec_get_err_info(&qdh->qdh_decoder); qdh->qdh_conn->cn_if->ci_abort_error(qdh->qdh_conn, 1, - HEC_QPACK_DECODER_STREAM_ERROR, "Error interpreting QPACK encoder " + HEC_QPACK_ENCODER_STREAM_ERROR, "Error interpreting QPACK encoder " "stream; offset %"PRIu64", line %d", qerr->off, qerr->line); goto end; } diff --git a/src/liblsquic/lsquic_trans_params.c b/src/liblsquic/lsquic_trans_params.c index 1c5fed4..bf6b468 100644 --- a/src/liblsquic/lsquic_trans_params.c +++ b/src/liblsquic/lsquic_trans_params.c @@ -153,7 +153,7 @@ static const uint64_t max_vals[MAX_NUMERIC_TPI + 1] = * it is not required by the spec and is not necessary. */ [TPI_MAX_UDP_PAYLOAD_SIZE] = VINT_MAX_VALUE, - [TPI_ACK_DELAY_EXPONENT] = VINT_MAX_VALUE, + [TPI_ACK_DELAY_EXPONENT] = TP_MAX_ACK_DELAY_EXP, [TPI_INIT_MAX_STREAMS_UNI] = 1ull << 60, [TPI_INIT_MAX_STREAMS_BIDI] = 1ull << 60, [TPI_INIT_MAX_DATA] = VINT_MAX_VALUE, diff --git a/src/liblsquic/lsquic_trans_params.h b/src/liblsquic/lsquic_trans_params.h index 03afbf1..22d101b 100644 --- a/src/liblsquic/lsquic_trans_params.h +++ b/src/liblsquic/lsquic_trans_params.h @@ -128,6 +128,9 @@ struct transport_params #define TP_DEF_MAX_ACK_DELAY 25u #define TP_DEF_ACTIVE_CONNECTION_ID_LIMIT 2 +/* [draft-ietf-quic-transport-34], Section 18.2 */ +#define TP_MAX_ACK_DELAY_EXP 20 + /* [draft-ietf-quic-transport-18], Section 18.1 */ #define TP_MAX_MAX_ACK_DELAY ((1u << 14) - 1)