mirror of
https://gitea.invidious.io/iv-org/litespeed-quic.git
synced 2024-08-15 00:53:43 +00:00
Release 1.19.5
- [BUGFIX] Use correct public key from PUBS based on KEXS index. - [BUGFIX] Check flags before dispatching writes, avoiding assert. - [BUGFIX] Set :scheme to "https" (instead of "HTTP").
This commit is contained in:
parent
90fe3b255d
commit
8437e4a4f2
5 changed files with 68 additions and 16 deletions
|
@ -1,4 +1,10 @@
|
||||||
2019-02-15
|
2019-03-05
|
||||||
|
- 1.19.5
|
||||||
|
- [BUGFIX] Use correct public key from PUBS based on KEXS index.
|
||||||
|
- [BUGFIX] Check flags before dispatching writes, avoiding assert.
|
||||||
|
- [BUGFIX] Set :scheme to "https" (instead of "HTTP").
|
||||||
|
|
||||||
|
2019-02-25
|
||||||
- 1.19.4
|
- 1.19.4
|
||||||
- [BUGFIX] Check buffer bounds when looking up version in 0-RTT blob.
|
- [BUGFIX] Check buffer bounds when looking up version in 0-RTT blob.
|
||||||
- [BUGFIX] http_client: don't fetch 0-rtt info if handshake failed.
|
- [BUGFIX] http_client: don't fetch 0-rtt info if handshake failed.
|
||||||
|
|
|
@ -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 4
|
#define LSQUIC_PATCH_VERSION 5
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Engine flags:
|
* Engine flags:
|
||||||
|
|
|
@ -2655,7 +2655,8 @@ process_streams_write_events (struct full_conn *conn, int high_prio)
|
||||||
|
|
||||||
for (stream = lsquic_spi_first(&spi); stream && write_is_possible(conn);
|
for (stream = lsquic_spi_first(&spi); stream && write_is_possible(conn);
|
||||||
stream = lsquic_spi_next(&spi))
|
stream = lsquic_spi_next(&spi))
|
||||||
lsquic_stream_dispatch_write_events(stream);
|
if (stream->stream_flags & STREAM_WRITE_Q_FLAGS)
|
||||||
|
lsquic_stream_dispatch_write_events(stream);
|
||||||
|
|
||||||
maybe_conn_flush_headers_stream(conn);
|
maybe_conn_flush_headers_stream(conn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,6 +109,7 @@ typedef struct hs_ctx_st
|
||||||
|
|
||||||
struct lsquic_str csct;
|
struct lsquic_str csct;
|
||||||
struct lsquic_str crt; /* compressed certs buffer */
|
struct lsquic_str crt; /* compressed certs buffer */
|
||||||
|
struct lsquic_str scfg_pubs; /* Need to copy PUBS, as KEXS comes after it */
|
||||||
} hs_ctx_t;
|
} hs_ctx_t;
|
||||||
|
|
||||||
|
|
||||||
|
@ -450,6 +451,7 @@ lsquic_enc_session_destroy (lsquic_enc_session_t *enc_session)
|
||||||
lsquic_str_d(&hs_ctx->prof);
|
lsquic_str_d(&hs_ctx->prof);
|
||||||
lsquic_str_d(&hs_ctx->csct);
|
lsquic_str_d(&hs_ctx->csct);
|
||||||
lsquic_str_d(&hs_ctx->crt);
|
lsquic_str_d(&hs_ctx->crt);
|
||||||
|
lsquic_str_d(&hs_ctx->scfg_pubs);
|
||||||
lsquic_str_d(&enc_session->chlo);
|
lsquic_str_d(&enc_session->chlo);
|
||||||
lsquic_str_d(&enc_session->sstk);
|
lsquic_str_d(&enc_session->sstk);
|
||||||
lsquic_str_d(&enc_session->ssno);
|
lsquic_str_d(&enc_session->ssno);
|
||||||
|
@ -586,18 +588,10 @@ static int parse_hs_data (lsquic_enc_session_t *enc_session, uint32_t tag,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QTAG_PUBS:
|
case QTAG_PUBS:
|
||||||
/* FIXME:Server side may send a list of pubs,
|
|
||||||
* we support only ONE kenx now.
|
|
||||||
* REJ is 35 bytes, SHLO is 32 bytes
|
|
||||||
* Only save other peer's pubs to hs_ctx
|
|
||||||
*/
|
|
||||||
if( len < 32)
|
|
||||||
break;
|
|
||||||
memcpy(hs_ctx->pubs, val + (len - 32), 32);
|
|
||||||
if (head_tag == QTAG_SCFG)
|
if (head_tag == QTAG_SCFG)
|
||||||
{
|
lsquic_str_setto(&hs_ctx->scfg_pubs, val, len);
|
||||||
memcpy(enc_session->info->spubs, hs_ctx->pubs, 32);
|
else if (len == 32)
|
||||||
}
|
memcpy(hs_ctx->pubs, val, len);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QTAG_RCID:
|
case QTAG_RCID:
|
||||||
|
@ -647,7 +641,58 @@ static int parse_hs_data (lsquic_enc_session_t *enc_session, uint32_t tag,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QTAG_KEXS:
|
case QTAG_KEXS:
|
||||||
enc_session->info->kexs = get_tag_value_i32(val, len);
|
{
|
||||||
|
if (head_tag == QTAG_SCFG && 0 == len % 4)
|
||||||
|
{
|
||||||
|
const unsigned char *p, *end;
|
||||||
|
unsigned pub_idx, idx;
|
||||||
|
|
||||||
|
for (p = val; p < val + len; p += 4)
|
||||||
|
if (0 == memcmp(p, "C255", 4))
|
||||||
|
{
|
||||||
|
memcpy(&enc_session->info->kexs, p, 4);
|
||||||
|
pub_idx = (p - val) / 4;
|
||||||
|
LSQ_DEBUG("Parsing SCFG: supported KEXS C255 at "
|
||||||
|
"index %u", pub_idx);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (p >= val + len)
|
||||||
|
{
|
||||||
|
LSQ_INFO("supported KEXS not found, trouble ahead");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (lsquic_str_len(&hs_ctx->scfg_pubs) > 0)
|
||||||
|
{
|
||||||
|
p = (const unsigned char *)
|
||||||
|
lsquic_str_cstr(&hs_ctx->scfg_pubs);
|
||||||
|
end = p + lsquic_str_len(&hs_ctx->scfg_pubs);
|
||||||
|
|
||||||
|
for (idx = 0; p < end; ++idx)
|
||||||
|
{
|
||||||
|
uint32_t sz = 0;
|
||||||
|
if (p + 3 > end)
|
||||||
|
break;
|
||||||
|
sz |= *p++;
|
||||||
|
sz |= *p++ << 8;
|
||||||
|
sz |= *p++ << 16;
|
||||||
|
if (p + sz > end)
|
||||||
|
break;
|
||||||
|
if (idx == pub_idx)
|
||||||
|
{
|
||||||
|
if (sz == 32)
|
||||||
|
{
|
||||||
|
memcpy(hs_ctx->pubs, p, 32);
|
||||||
|
memcpy(enc_session->info->spubs, p, 32);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
p += sz;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
LSQ_INFO("No PUBS from SCFG to parse");
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QTAG_NONC:
|
case QTAG_NONC:
|
||||||
|
|
|
@ -506,7 +506,7 @@ send_headers (lsquic_stream_ctx_t *st_h)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = { .iov_base = ":scheme", .iov_len = 7, },
|
.name = { .iov_base = ":scheme", .iov_len = 7, },
|
||||||
.value = { .iov_base = "HTTP", .iov_len = 4, }
|
.value = { .iov_base = "https", .iov_len = 5, }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = { .iov_base = ":path", .iov_len = 5, },
|
.name = { .iov_base = ":path", .iov_len = 5, },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue