Release 3.0.5

This commit is contained in:
George Wang 2022-04-27 15:40:59 -04:00
parent dbc62fc9fa
commit e237d77919
6 changed files with 28 additions and 35 deletions

View file

@ -1654,9 +1654,9 @@ check_server_tps_for_violations (const struct enc_sess_iquic *enc_sess,
for (tpi = 0; tpi <= MAX_NUMERIC_TPI; ++tpi) for (tpi = 0; tpi <= MAX_NUMERIC_TPI; ++tpi)
if ((1 << tpi) & REDUCTION_PROHIBITED_TPS) if ((1 << tpi) & REDUCTION_PROHIBITED_TPS)
if (new_params->tp_numerics[tpi] > params_0rtt->tp_numerics[tpi]) if (new_params->tp_numerics[tpi] < params_0rtt->tp_numerics[tpi])
{ {
LSQ_INFO("server's new TP %s increased in value from %"PRIu64 LSQ_INFO("server's new TP %s decreased in value from %"PRIu64
" to %"PRIu64, lsquic_tpi2str[tpi], " to %"PRIu64, lsquic_tpi2str[tpi],
params_0rtt->tp_numerics[tpi], params_0rtt->tp_numerics[tpi],
new_params->tp_numerics[tpi]); new_params->tp_numerics[tpi]);

View file

@ -2900,11 +2900,12 @@ ietf_full_conn_ci_want_datagram_write (struct lsquic_conn *lconn, int is_want)
if (conn->ifc_flags & IFC_DATAGRAMS) if (conn->ifc_flags & IFC_DATAGRAMS)
{ {
old = !!(conn->ifc_mflags & MF_WANT_DATAGRAM_WRITE); old = !!(conn->ifc_mflags & MF_WANT_DATAGRAM_WRITE);
if (is_want) { if (is_want)
{
conn->ifc_mflags |= MF_WANT_DATAGRAM_WRITE; conn->ifc_mflags |= MF_WANT_DATAGRAM_WRITE;
if (lsquic_send_ctl_can_send (&conn->ifc_send_ctl)) if (lsquic_send_ctl_can_send (&conn->ifc_send_ctl))
lsquic_engine_add_conn_to_tickable(conn->ifc_enpub, lsquic_engine_add_conn_to_tickable(conn->ifc_enpub,
&conn->ifc_conn); &conn->ifc_conn);
} }
else else
conn->ifc_mflags &= ~MF_WANT_DATAGRAM_WRITE; conn->ifc_mflags &= ~MF_WANT_DATAGRAM_WRITE;

View file

@ -1816,23 +1816,23 @@ get_valid_scfg (const struct lsquic_enc_session *enc_session,
unsigned msg_len, server_config_sz; unsigned msg_len, server_config_sz;
struct message_writer mw; struct message_writer mw;
if (enc_session->enpub->enp_server_config->lsc_scfg && (enc_session->enpub->enp_server_config->lsc_scfg->info.expy > (uint64_t)t)) if (enpub->enp_server_config->lsc_scfg && (enpub->enp_server_config->lsc_scfg->info.expy > (uint64_t)t))
return enc_session->enpub->enp_server_config; return enpub->enp_server_config;
ret = shi->shi_lookup(shi_ctx, SERVER_SCFG_KEY, SERVER_SCFG_KEY_SIZE, ret = shi->shi_lookup(shi_ctx, SERVER_SCFG_KEY, SERVER_SCFG_KEY_SIZE,
&scfg_ptr, &real_len); &scfg_ptr, &real_len);
if (ret == 1) if (ret == 1)
{ {
if (config_has_correct_size(enc_session, scfg_ptr, real_len) && if (config_has_correct_size(enc_session, scfg_ptr, real_len) &&
(enc_session->enpub->enp_server_config->lsc_scfg = scfg_ptr, (enpub->enp_server_config->lsc_scfg = scfg_ptr,
enc_session->enpub->enp_server_config->lsc_scfg->info.expy > (uint64_t)t)) enpub->enp_server_config->lsc_scfg->info.expy > (uint64_t)t))
{ {
/* Why need to init here, because this memory may be read from SHM, /* Why need to init here, because this memory may be read from SHM,
* the struct is ready but AEAD_CTX is not ready. * the struct is ready but AEAD_CTX is not ready.
**/ **/
EVP_AEAD_CTX_init(&enc_session->enpub->enp_server_config->lsc_stk_ctx, EVP_aead_aes_128_gcm(), EVP_AEAD_CTX_init(&enpub->enp_server_config->lsc_stk_ctx, EVP_aead_aes_128_gcm(),
enc_session->enpub->enp_server_config->lsc_scfg->info.skt_key, 16, 12, NULL); enpub->enp_server_config->lsc_scfg->info.skt_key, 16, 12, NULL);
return enc_session->enpub->enp_server_config; return enpub->enp_server_config;
} }
else else
{ {
@ -1850,12 +1850,12 @@ get_valid_scfg (const struct lsquic_enc_session *enc_session,
MSG_LEN_ADD(msg_len, sizeof(temp_scfg->orbt)); MSG_LEN_ADD(msg_len, sizeof(temp_scfg->orbt));
MSG_LEN_ADD(msg_len, sizeof(temp_scfg->expy)); MSG_LEN_ADD(msg_len, sizeof(temp_scfg->expy));
server_config_sz = sizeof(*enc_session->enpub->enp_server_config->lsc_scfg) + MSG_LEN_VAL(msg_len); server_config_sz = sizeof(*enpub->enp_server_config->lsc_scfg) + MSG_LEN_VAL(msg_len);
enc_session->enpub->enp_server_config->lsc_scfg = malloc(server_config_sz); enpub->enp_server_config->lsc_scfg = malloc(server_config_sz);
if (!enc_session->enpub->enp_server_config->lsc_scfg) if (!enpub->enp_server_config->lsc_scfg)
return NULL; return NULL;
temp_scfg = &enc_session->enpub->enp_server_config->lsc_scfg->info; temp_scfg = &enpub->enp_server_config->lsc_scfg->info;
RAND_bytes(temp_scfg->skt_key, sizeof(temp_scfg->skt_key)); RAND_bytes(temp_scfg->skt_key, sizeof(temp_scfg->skt_key));
RAND_bytes(temp_scfg->sscid, sizeof(temp_scfg->sscid)); RAND_bytes(temp_scfg->sscid, sizeof(temp_scfg->sscid));
RAND_bytes(temp_scfg->priv_key, sizeof(temp_scfg->priv_key)); RAND_bytes(temp_scfg->priv_key, sizeof(temp_scfg->priv_key));
@ -1866,7 +1866,7 @@ get_valid_scfg (const struct lsquic_enc_session *enc_session,
temp_scfg->orbt = 0; temp_scfg->orbt = 0;
temp_scfg->expy = t + settings->es_sttl; temp_scfg->expy = t + settings->es_sttl;
MW_BEGIN(&mw, QTAG_SCFG, 8, enc_session->enpub->enp_server_config->lsc_scfg->scfg); MW_BEGIN(&mw, QTAG_SCFG, 8, enpub->enp_server_config->lsc_scfg->scfg);
MW_WRITE_BUFFER(&mw, QTAG_VER, enpub->enp_ver_tags_buf, MW_WRITE_BUFFER(&mw, QTAG_VER, enpub->enp_ver_tags_buf,
enpub->enp_ver_tags_len); enpub->enp_ver_tags_len);
MW_WRITE_UINT32(&mw, QTAG_AEAD, temp_scfg->aead); MW_WRITE_UINT32(&mw, QTAG_AEAD, temp_scfg->aead);
@ -1877,7 +1877,7 @@ get_valid_scfg (const struct lsquic_enc_session *enc_session,
MW_WRITE_UINT64(&mw, QTAG_ORBT, temp_scfg->orbt); MW_WRITE_UINT64(&mw, QTAG_ORBT, temp_scfg->orbt);
MW_WRITE_UINT64(&mw, QTAG_EXPY, temp_scfg->expy); MW_WRITE_UINT64(&mw, QTAG_EXPY, temp_scfg->expy);
MW_END(&mw); MW_END(&mw);
assert(MW_P(&mw) == enc_session->enpub->enp_server_config->lsc_scfg->scfg + MSG_LEN_VAL(msg_len)); assert(MW_P(&mw) == enpub->enp_server_config->lsc_scfg->scfg + MSG_LEN_VAL(msg_len));
temp_scfg->scfg_len = MSG_LEN_VAL(msg_len); temp_scfg->scfg_len = MSG_LEN_VAL(msg_len);
@ -1887,17 +1887,17 @@ get_valid_scfg (const struct lsquic_enc_session *enc_session,
// shi->shi_delete(shi_ctx, SERVER_SCFG_KEY, SERVER_SCFG_KEY_SIZE); // shi->shi_delete(shi_ctx, SERVER_SCFG_KEY, SERVER_SCFG_KEY_SIZE);
void *scfg_key = strdup(SERVER_SCFG_KEY); void *scfg_key = strdup(SERVER_SCFG_KEY);
shi->shi_insert(shi_ctx, scfg_key, SERVER_SCFG_KEY_SIZE, shi->shi_insert(shi_ctx, scfg_key, SERVER_SCFG_KEY_SIZE,
enc_session->enpub->enp_server_config->lsc_scfg, server_config_sz, t + settings->es_sttl); enpub->enp_server_config->lsc_scfg, server_config_sz, t + settings->es_sttl);
ret = shi->shi_lookup(shi_ctx, scfg_key, SERVER_SCFG_KEY_SIZE, ret = shi->shi_lookup(shi_ctx, scfg_key, SERVER_SCFG_KEY_SIZE,
&scfg_ptr, &real_len); &scfg_ptr, &real_len);
if (ret == 1) if (ret == 1)
{ {
tmp_scfg_copy = scfg_ptr; tmp_scfg_copy = scfg_ptr;
if (tmp_scfg_copy != enc_session->enpub->enp_server_config->lsc_scfg) if (tmp_scfg_copy != enpub->enp_server_config->lsc_scfg)
{ {
free(enc_session->enpub->enp_server_config->lsc_scfg); free(enpub->enp_server_config->lsc_scfg);
enc_session->enpub->enp_server_config->lsc_scfg = tmp_scfg_copy; enpub->enp_server_config->lsc_scfg = tmp_scfg_copy;
} }
} }
else else
@ -1906,12 +1906,12 @@ get_valid_scfg (const struct lsquic_enc_session *enc_session,
LSQ_DEBUG("get_valid_scfg got an shi internal error.\n"); LSQ_DEBUG("get_valid_scfg got an shi internal error.\n");
} }
ret = EVP_AEAD_CTX_init(&enc_session->enpub->enp_server_config->lsc_stk_ctx, EVP_aead_aes_128_gcm(), ret = EVP_AEAD_CTX_init(&enpub->enp_server_config->lsc_stk_ctx, EVP_aead_aes_128_gcm(),
enc_session->enpub->enp_server_config->lsc_scfg->info.skt_key, enpub->enp_server_config->lsc_scfg->info.skt_key,
sizeof(enc_session->enpub->enp_server_config->lsc_scfg->info.skt_key), 12, NULL); sizeof(enpub->enp_server_config->lsc_scfg->info.skt_key), 12, NULL);
LSQ_DEBUG("get_valid_scfg::EVP_AEAD_CTX_init return %d.", ret); LSQ_DEBUG("get_valid_scfg::EVP_AEAD_CTX_init return %d.", ret);
return enc_session->enpub->enp_server_config; return enpub->enp_server_config;
} }

View file

@ -68,11 +68,6 @@ int
lsquic_ietf_v1_gen_ver_nego_pkt (unsigned char *buf, size_t bufsz, lsquic_ietf_v1_gen_ver_nego_pkt (unsigned char *buf, size_t bufsz,
const lsquic_cid_t *scid, const lsquic_cid_t *dcid, unsigned versions, const lsquic_cid_t *scid, const lsquic_cid_t *dcid, unsigned versions,
uint8_t); uint8_t);
int
lsquic_iquic_gen_retry_pkt (unsigned char *buf, size_t bufsz,
const struct lsquic_engine_public *, const lsquic_cid_t *scid,
const lsquic_cid_t *dcid, enum lsquic_version, const struct sockaddr *,
uint8_t random_nybble);
#define GQUIC_RESET_SZ 33 #define GQUIC_RESET_SZ 33
ssize_t ssize_t

View file

@ -452,10 +452,6 @@ static void
qdh_hblock_unblocked (void *stream_p) qdh_hblock_unblocked (void *stream_p)
{ {
struct lsquic_stream *const stream = stream_p; struct lsquic_stream *const stream = stream_p;
union hblock_ctx *const u = stream->sm_hblock_ctx;
struct qpack_dec_hdl *qdh = u->ctx.qdh;
LSQ_DEBUG("header block for stream %"PRIu64" unblocked", stream->id);
lsquic_stream_qdec_unblocked(stream); lsquic_stream_qdec_unblocked(stream);
} }

View file

@ -2392,7 +2392,8 @@ lsquic_stream_dispatch_write_events (lsquic_stream_t *stream)
unsigned short n_buffered; unsigned short n_buffered;
enum stream_q_flags q_flags; enum stream_q_flags q_flags;
if (!(stream->sm_qflags & SMQF_WRITE_Q_FLAGS)) if (!(stream->sm_qflags & SMQF_WRITE_Q_FLAGS)
|| (stream->stream_flags & STREAM_FINISHED))
return; return;
q_flags = stream->sm_qflags & SMQF_WRITE_Q_FLAGS; q_flags = stream->sm_qflags & SMQF_WRITE_Q_FLAGS;