mirror of
https://gitea.invidious.io/iv-org/litespeed-quic.git
synced 2024-08-15 00:53:43 +00:00
Release 1.19.2
- [BUGFIX] Begin negotiation with version provided in 0-RTT info. - [BUGFIX] Version checking in zero_rtt deserialize function.
This commit is contained in:
parent
4c244ff72d
commit
3329170846
6 changed files with 30 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2019-02-11
|
||||||
|
- 1.19.2
|
||||||
|
- [BUGFIX] Begin negotiation with version provided in 0-RTT info.
|
||||||
|
- [BUGFIX] Version checking in zero_rtt deserialize function.
|
||||||
|
|
||||||
2019-02-04
|
2019-02-04
|
||||||
- 1.19.1
|
- 1.19.1
|
||||||
- [BUGFIX] Fix Windows build.
|
- [BUGFIX] Fix Windows build.
|
||||||
|
|
|
@ -25,7 +25,7 @@ extern "C" {
|
||||||
|
|
||||||
#define LSQUIC_MAJOR_VERSION 1
|
#define LSQUIC_MAJOR_VERSION 1
|
||||||
#define LSQUIC_MINOR_VERSION 19
|
#define LSQUIC_MINOR_VERSION 19
|
||||||
#define LSQUIC_PATCH_VERSION 1
|
#define LSQUIC_PATCH_VERSION 2
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Engine flags:
|
* Engine flags:
|
||||||
|
|
|
@ -369,10 +369,11 @@ calc_mem_used (const struct full_conn *conn)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_versions (struct full_conn *conn, unsigned versions)
|
set_versions (struct full_conn *conn, unsigned versions,
|
||||||
|
enum lsquic_version *ver)
|
||||||
{
|
{
|
||||||
conn->fc_ver_neg.vn_supp = versions;
|
conn->fc_ver_neg.vn_supp = versions;
|
||||||
conn->fc_ver_neg.vn_ver = highest_bit_set(versions);
|
conn->fc_ver_neg.vn_ver = (ver) ? *ver : highest_bit_set(versions);
|
||||||
conn->fc_ver_neg.vn_buf = lsquic_ver2tag(conn->fc_ver_neg.vn_ver);
|
conn->fc_ver_neg.vn_buf = lsquic_ver2tag(conn->fc_ver_neg.vn_ver);
|
||||||
conn->fc_conn.cn_version = conn->fc_ver_neg.vn_ver;
|
conn->fc_conn.cn_version = conn->fc_ver_neg.vn_ver;
|
||||||
conn->fc_conn.cn_pf = select_pf_by_ver(conn->fc_ver_neg.vn_ver);
|
conn->fc_conn.cn_pf = select_pf_by_ver(conn->fc_ver_neg.vn_ver);
|
||||||
|
@ -382,9 +383,10 @@ set_versions (struct full_conn *conn, unsigned versions)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_ver_neg (struct full_conn *conn, unsigned versions)
|
init_ver_neg (struct full_conn *conn, unsigned versions,
|
||||||
|
enum lsquic_version *ver)
|
||||||
{
|
{
|
||||||
set_versions(conn, versions);
|
set_versions(conn, versions, ver);
|
||||||
conn->fc_ver_neg.vn_tag = &conn->fc_ver_neg.vn_buf;
|
conn->fc_ver_neg.vn_tag = &conn->fc_ver_neg.vn_buf;
|
||||||
conn->fc_ver_neg.vn_state = VN_START;
|
conn->fc_ver_neg.vn_state = VN_START;
|
||||||
}
|
}
|
||||||
|
@ -641,11 +643,19 @@ full_conn_client_new (struct lsquic_engine_public *enpub,
|
||||||
const unsigned char *zero_rtt, size_t zero_rtt_len)
|
const unsigned char *zero_rtt, size_t zero_rtt_len)
|
||||||
{
|
{
|
||||||
struct full_conn *conn;
|
struct full_conn *conn;
|
||||||
enum lsquic_version version;
|
enum lsquic_version version, zero_rtt_version;
|
||||||
lsquic_cid_t cid;
|
lsquic_cid_t cid;
|
||||||
const struct enc_session_funcs *esf;
|
const struct enc_session_funcs *esf;
|
||||||
|
|
||||||
version = highest_bit_set(enpub->enp_settings.es_versions);
|
version = highest_bit_set(enpub->enp_settings.es_versions);
|
||||||
|
if (zero_rtt)
|
||||||
|
{
|
||||||
|
zero_rtt_version = lsquic_tag2ver(
|
||||||
|
((struct lsquic_zero_rtt_storage *)zero_rtt)->quic_version_tag);
|
||||||
|
if (zero_rtt_version < N_LSQVER &&
|
||||||
|
((1 << zero_rtt_version) & enpub->enp_settings.es_versions))
|
||||||
|
version = zero_rtt_version;
|
||||||
|
}
|
||||||
esf = select_esf_by_ver(version);
|
esf = select_esf_by_ver(version);
|
||||||
cid = esf->esf_generate_cid();
|
cid = esf->esf_generate_cid();
|
||||||
conn = new_conn_common(cid, enpub, stream_if, stream_if_ctx, flags,
|
conn = new_conn_common(cid, enpub, stream_if, stream_if_ctx, flags,
|
||||||
|
@ -673,7 +683,7 @@ full_conn_client_new (struct lsquic_engine_public *enpub,
|
||||||
conn->fc_stream_ifs[STREAM_IF_HSK]
|
conn->fc_stream_ifs[STREAM_IF_HSK]
|
||||||
.stream_if = &lsquic_client_hsk_stream_if;
|
.stream_if = &lsquic_client_hsk_stream_if;
|
||||||
conn->fc_stream_ifs[STREAM_IF_HSK].stream_if_ctx = &conn->fc_hsk_ctx.client;
|
conn->fc_stream_ifs[STREAM_IF_HSK].stream_if_ctx = &conn->fc_hsk_ctx.client;
|
||||||
init_ver_neg(conn, conn->fc_settings->es_versions);
|
init_ver_neg(conn, conn->fc_settings->es_versions, &version);
|
||||||
if (conn->fc_settings->es_handshake_to)
|
if (conn->fc_settings->es_handshake_to)
|
||||||
lsquic_alarmset_set(&conn->fc_alset, AL_HANDSHAKE,
|
lsquic_alarmset_set(&conn->fc_alset, AL_HANDSHAKE,
|
||||||
lsquic_time_now() + conn->fc_settings->es_handshake_to);
|
lsquic_time_now() + conn->fc_settings->es_handshake_to);
|
||||||
|
@ -1926,7 +1936,7 @@ process_ver_neg_packet (struct full_conn *conn, lsquic_packet_in_t *packet_in)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_versions(conn, versions);
|
set_versions(conn, versions, NULL);
|
||||||
conn->fc_ver_neg.vn_state = VN_IN_PROGRESS;
|
conn->fc_ver_neg.vn_state = VN_IN_PROGRESS;
|
||||||
lsquic_send_ctl_expire_all(&conn->fc_send_ctl);
|
lsquic_send_ctl_expire_all(&conn->fc_send_ctl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,6 +313,7 @@ lsquic_enc_session_deserialize_zero_rtt(
|
||||||
lsquic_session_cache_info_t *info,
|
lsquic_session_cache_info_t *info,
|
||||||
c_cert_item_t *cert_item)
|
c_cert_item_t *cert_item)
|
||||||
{
|
{
|
||||||
|
enum lsquic_version ver;
|
||||||
uint32_t i, len;
|
uint32_t i, len;
|
||||||
uint64_t hash;
|
uint64_t hash;
|
||||||
uint32_t *cert_len;
|
uint32_t *cert_len;
|
||||||
|
@ -321,7 +322,8 @@ lsquic_enc_session_deserialize_zero_rtt(
|
||||||
/*
|
/*
|
||||||
* check versions
|
* check versions
|
||||||
*/
|
*/
|
||||||
if (lsquic_tag2ver(storage->quic_version_tag) & ~settings->es_versions)
|
ver = lsquic_tag2ver(storage->quic_version_tag);
|
||||||
|
if ((int)ver == -1 || !((1 << ver) & settings->es_versions))
|
||||||
return RTT_DESERIALIZE_BAD_QUIC_VER;
|
return RTT_DESERIALIZE_BAD_QUIC_VER;
|
||||||
if (storage->serializer_version != RTT_SERIALIZER_VERSION)
|
if (storage->serializer_version != RTT_SERIALIZER_VERSION)
|
||||||
return RTT_DESERIALIZE_BAD_SERIAL_VER;
|
return RTT_DESERIALIZE_BAD_SERIAL_VER;
|
||||||
|
|
|
@ -905,7 +905,8 @@ lsquic_send_ctl_cleanup (lsquic_send_ctl_t *ctl)
|
||||||
send_ctl_destroy_packet(ctl, packet_out);
|
send_ctl_destroy_packet(ctl, packet_out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pacer_cleanup(&ctl->sc_pacer);
|
if (ctl->sc_flags & SC_PACE)
|
||||||
|
pacer_cleanup(&ctl->sc_pacer);
|
||||||
#if LSQUIC_SEND_STATS
|
#if LSQUIC_SEND_STATS
|
||||||
LSQ_NOTICE("stats: n_total_sent: %u; n_resent: %u; n_delayed: %u",
|
LSQ_NOTICE("stats: n_total_sent: %u; n_resent: %u; n_delayed: %u",
|
||||||
ctl->sc_stats.n_total_sent, ctl->sc_stats.n_resent,
|
ctl->sc_stats.n_total_sent, ctl->sc_stats.n_resent,
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
*/
|
*/
|
||||||
struct ver_neg {
|
struct ver_neg {
|
||||||
unsigned vn_supp; /* Remaining options, including `vn_ver' */
|
unsigned vn_supp; /* Remaining options, including `vn_ver' */
|
||||||
enum lsquic_version vn_ver; /* If client, current version sent to server;
|
enum lsquic_version vn_ver; /* If client, current version sent to server
|
||||||
|
* (zero_rtt version or highest supported);
|
||||||
* if server, this is set to negotiated version.
|
* if server, this is set to negotiated version.
|
||||||
*/
|
*/
|
||||||
enum ver_neg_state {
|
enum ver_neg_state {
|
||||||
|
|
Loading…
Reference in a new issue