Skip to content

Commit

Permalink
Release 1.19.4
Browse files Browse the repository at this point in the history
- [BUGFIX] Check buffer bounds when looking up version in 0-RTT blob.
- [BUGFIX] http_client: don't fetch 0-rtt info if handshake failed.
- Log number of pacer calls at DEBUG, rather than NOTICE, level.
  • Loading branch information
Dmitri Tikhonov committed Feb 25, 2019
1 parent 9c44452 commit 90fe3b2
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2019-02-15
- 1.19.4
- [BUGFIX] Check buffer bounds when looking up version in 0-RTT blob.
- [BUGFIX] http_client: don't fetch 0-rtt info if handshake failed.
- Log number of pacer calls at DEBUG, rather than NOTICE, level.

2019-02-18
- 1.19.3
- [BUGFIX] Q044: don't encode packet number in 6 bytes. Six-byte
Expand Down
2 changes: 1 addition & 1 deletion include/lsquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern "C" {

#define LSQUIC_MAJOR_VERSION 1
#define LSQUIC_MINOR_VERSION 19
#define LSQUIC_PATCH_VERSION 3
#define LSQUIC_PATCH_VERSION 4

/**
* Engine flags:
Expand Down
6 changes: 4 additions & 2 deletions src/liblsquic/lsquic_full_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#endif
#include <sys/queue.h>

#include <openssl/ssl.h>

#include "lsquic_types.h"
#include "lsquic.h"
#include "lsquic_alarmset.h"
Expand Down Expand Up @@ -51,6 +53,7 @@
#include "lsquic_version.h"
#include "lsquic_hash.h"
#include "lsquic_headers.h"
#include "lsquic_handshake.h"

#include "lsquic_conn.h"
#include "lsquic_conn_public.h"
Expand Down Expand Up @@ -650,8 +653,7 @@ full_conn_client_new (struct lsquic_engine_public *enpub,
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);
zero_rtt_version = lsquic_zero_rtt_version(zero_rtt, zero_rtt_len);
if (zero_rtt_version < N_LSQVER &&
((1 << zero_rtt_version) & enpub->enp_settings.es_versions))
version = zero_rtt_version;
Expand Down
15 changes: 15 additions & 0 deletions src/liblsquic/lsquic_handshake.c
Original file line number Diff line number Diff line change
Expand Up @@ -1971,3 +1971,18 @@ const char *const lsquic_enclev2str[] =
[ENC_LEV_INIT] = "initial",
[ENC_LEV_FORW] = "forw-secure",
};


enum lsquic_version
lsquic_zero_rtt_version (const unsigned char *buf, size_t bufsz)
{
lsquic_ver_tag_t tag;

if (bufsz >= sizeof(tag))
{
memcpy(&tag, buf, sizeof(tag));
return lsquic_tag2ver(tag);
}
else
return -1;
}
3 changes: 3 additions & 0 deletions src/liblsquic/lsquic_handshake.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,7 @@ struct enc_session_funcs lsquic_enc_session_gquic_1;
#define select_esf_by_ver(ver) \
(ver ? &lsquic_enc_session_gquic_1 : &lsquic_enc_session_gquic_1)

enum lsquic_version
lsquic_zero_rtt_version (const unsigned char *, size_t);

#endif
2 changes: 1 addition & 1 deletion src/liblsquic/lsquic_pacer.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void
pacer_cleanup (struct pacer *pacer)
{
#ifndef NDEBUG
LSQ_NOTICE("scheduled calls: %u", pacer->pa_stats.n_scheduled);
LSQ_DEBUG("scheduled calls: %u", pacer->pa_stats.n_scheduled);
#endif
}

Expand Down
3 changes: 1 addition & 2 deletions test/http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,7 @@ http_client_on_hsk_done (lsquic_conn_t *conn, enum lsquic_hsk_status status)
else
LSQ_INFO("handshake success %s",
status == LSQ_HSK_0RTT_OK ? "with 0-RTT" : "");
if (!(client_ctx->hcc_flags & HCC_RTT_INFO) ||
((client_ctx->hcc_flags & HCC_RTT_INFO) && status != LSQ_HSK_0RTT_OK))
if (status == LSQ_HSK_OK)
{
ret = lsquic_conn_get_zero_rtt(conn, client_ctx->hcc_zero_rtt,
client_ctx->hcc_zero_rtt_max_len);
Expand Down

0 comments on commit 90fe3b2

Please sign in to comment.