Release 2.6.3

- [BUGFIX] Close DATA frames with empty payload correctly.
This commit is contained in:
Dmitri Tikhonov 2019-11-12 14:29:32 -05:00
parent 767cf6112c
commit 2f7aa65884
8 changed files with 136 additions and 37 deletions

View file

@ -99,9 +99,6 @@ struct enc_session_funcs_common
int
(*esf_alg_keysize) (enc_session_t *);
const char *
(*esf_get_sni) (enc_session_t *);
enum enc_packout
(*esf_encrypt_packet) (enc_session_t *, const struct lsquic_engine_public *,
struct lsquic_conn *, struct lsquic_packet_out *);

View file

@ -1013,8 +1013,8 @@ iquic_lookup_cert (SSL *ssl, void *arg)
#endif
if (!server_name)
{
LSQ_DEBUG("cert lookup: server name is not set, error");
return 0;
LSQ_DEBUG("cert lookup: server name is not set, skip");
return 1;
}
path = enc_sess->esi_conn->cn_if->ci_get_path(enc_sess->esi_conn, NULL);
@ -2048,15 +2048,6 @@ iquic_esf_decrypt_packet (enc_session_t *enc_session_p,
}
static const char *
iquic_esf_get_sni (enc_session_t *enc_session_p)
{
struct enc_sess_iquic *const enc_sess = enc_session_p;
return SSL_get_servername(enc_sess->esi_ssl, TLSEXT_NAMETYPE_host_name);
}
static int
iquic_esf_global_init (int flags)
{
@ -2240,7 +2231,6 @@ const struct enc_session_funcs_common lsquic_enc_session_common_ietf_v1 =
.esf_tag_len = IQUIC_TAG_LEN,
.esf_get_server_cert_chain
= iquic_esf_get_server_cert_chain,
.esf_get_sni = iquic_esf_get_sni,
.esf_cipher = iquic_esf_cipher,
.esf_keysize = iquic_esf_keysize,
.esf_alg_keysize = iquic_esf_alg_keysize,

View file

@ -5464,6 +5464,11 @@ process_retry_packet (struct ietf_full_conn *conn,
if (conn->ifc_flags & (IFC_SERVER|IFC_RETRIED))
{
/* [draft-ietf-quic-transport-24] Section 17.2.5:
" After the client has received and processed an Initial or Retry
" packet from the server, it MUST discard any subsequent Retry
" packets that it receives.
*/
LSQ_DEBUG("ignore Retry packet");
return 0;
}

View file

@ -3281,13 +3281,6 @@ set_handshake_completed (struct lsquic_enc_session *enc_session)
#endif
static const char *
lsquic_enc_session_get_sni (enc_session_t *enc_session_p)
{
struct lsquic_enc_session *const enc_session = enc_session_p;
return lsquic_str_cstr(&enc_session->hs_ctx.sni);
}
#ifndef NDEBUG
static uint8_t
@ -3631,7 +3624,6 @@ struct enc_session_funcs_common lsquic_enc_session_common_gquic_1 =
.esf_cipher = lsquic_enc_session_cipher,
.esf_keysize = lsquic_enc_session_keysize,
.esf_alg_keysize = lsquic_enc_session_alg_keysize,
.esf_get_sni = lsquic_enc_session_get_sni,
.esf_encrypt_packet = gquic_encrypt_packet,
.esf_decrypt_packet = gquic_decrypt_packet,
.esf_tag_len = GQUIC_PACKET_HASH_SZ,

View file

@ -2536,7 +2536,6 @@ open_hq_frame (struct lsquic_stream *stream)
}
/* Returns index of the new frame */
static struct stream_hq_frame *
stream_activate_hq_frame (struct lsquic_stream *stream, uint64_t off,
enum hq_frame_type frame_type, enum shf_flags flags, size_t size)
@ -2915,7 +2914,7 @@ maybe_close_varsize_hq_frame (struct lsquic_stream *stream)
bits = (shf->shf_flags & SHF_TWO_BYTES) > 0;
size = stream->sm_payload + stream->sm_n_buffered - shf->shf_off;
if (size && size <= VINT_MAX_B(bits) && shf->shf_frame_ptr)
if (size <= VINT_MAX_B(bits) && shf->shf_frame_ptr)
{
if (0 == stream->sm_n_buffered)
LSQ_DEBUG("close HQ frame type 0x%X of size %"PRIu64,
@ -2935,23 +2934,18 @@ maybe_close_varsize_hq_frame (struct lsquic_stream *stream)
}
else if (!shf->shf_frame_ptr)
{
LSQ_WARN("dangling HTTP/3 frame");
LSQ_ERROR("dangling HTTP/3 frame, on stream %"PRIu64, stream->id);
stream->conn_pub->lconn->cn_if->ci_internal_error(
stream->conn_pub->lconn, "dangling HTTP/3 frame on stream %"PRIu64,
stream->id);
stream_hq_frame_put(stream, shf);
}
else if (!size)
{
LSQ_WARN("discard zero-sized HQ frame type 0x%X (off: %"PRIu64")",
shf->shf_frame_type, shf->shf_off);
stream->conn_pub->lconn, "dangling HTTP/3 frame");
stream_hq_frame_put(stream, shf);
}
else
{
assert(stream->sm_n_buffered);
LSQ_ERROR("cannot close frame of size %"PRIu64" -- too large", size);
/* TODO: abort connection */
LSQ_ERROR("cannot close frame of size %"PRIu64" on stream %"PRIu64
" -- too large", size, stream->id);
stream->conn_pub->lconn->cn_if->ci_internal_error(
stream->conn_pub->lconn, "HTTP/3 frame too large");
stream_hq_frame_put(stream, shf);
}
}