From 4b332c36d10c14688ca6adb59b9ae630cdc6f33a Mon Sep 17 00:00:00 2001 From: Dmitri Tikhonov Date: Fri, 4 May 2018 11:53:50 -0400 Subject: [PATCH] Latest changes - Remove comment: MSPC is obsolete (no code changes) - Prog: use lsquic_str2ver() when processing -o version flag - Remove unused CTIM and SRBF transport parameters - Disable QUIC versions Q037 and Q038 by default - Fix Windows compilation by including compat header file in lshpack.c - Address warnings produced by newer versions of gcc - Future-proof: turn off -Werror --- CHANGELOG | 11 +++++++++++ CMakeLists.txt | 2 -- include/lsquic.h | 5 ++++- src/liblsquic/lsquic_handshake.c | 17 ----------------- src/liblsquic/lsquic_qtags.h | 2 -- test/test_common.c | 25 +++---------------------- 6 files changed, 18 insertions(+), 44 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5153caa..9da775e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,14 @@ +2018-05-04 + + - Remove comment: MSPC is obsolete (no code changes) + - Prog: use lsquic_str2ver() when processing -o version flag + - Remove unused CTIM and SRBF transport parameters + - Disable QUIC versions Q037 and Q038 by default + - Fix Windows compilation by including compat header file in + lshpack.c + - Address warnings produced by newer versions of gcc + - Future-proof: turn off -Werror + 2018-05-02 - [BUGFIX] Make lsquic_conn_quic_version() available diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cf09d0..9df44cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,8 +45,6 @@ IF(CMAKE_COMPILER_IS_GNUCC AND ( ENDIF() IF(DEVEL_MODE EQUAL 1) SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -O0 -g3") - # -Werror is used to force us to fix warnings early. - SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -Werror") IF(CMAKE_C_COMPILER MATCHES "clang" AND NOT "$ENV{TRAVIS}" MATCHES "^true$") SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -fsanitize=address") diff --git a/include/lsquic.h b/include/lsquic.h index d27e3b6..d5b9a75 100644 --- a/include/lsquic.h +++ b/include/lsquic.h @@ -88,6 +88,8 @@ enum lsquic_version #define LSQUIC_EXPERIMENTAL_VERSIONS ((1 << LSQVER_041)) +#define LSQUIC_DEPRECATED_VERSIONS ((1 << LSQVER_037) | (1 << LSQVER_038)) + /** * @struct lsquic_stream_if * @brief The definition of callback functions call by lsquic_stream to @@ -136,9 +138,10 @@ struct lsquic_stream_if { */ /** - * By default, experimental versions are not included. + * By default, deprecated and experimental versions are not included. */ #define LSQUIC_DF_VERSIONS (LSQUIC_SUPPORTED_VERSIONS & \ + ~LSQUIC_DEPRECATED_VERSIONS & \ ~LSQUIC_EXPERIMENTAL_VERSIONS) #define LSQUIC_DF_CFCW_SERVER (3 * 1024 * 1024 / 2) diff --git a/src/liblsquic/lsquic_handshake.c b/src/liblsquic/lsquic_handshake.c index c5dd815..fe19cb8 100644 --- a/src/liblsquic/lsquic_handshake.c +++ b/src/liblsquic/lsquic_handshake.c @@ -84,14 +84,12 @@ typedef struct hs_ctx_st uint32_t scls; uint32_t cfcw; uint32_t sfcw; - uint32_t srbf; uint32_t icsl; uint32_t irtt; uint64_t rcid; uint32_t tcid; uint32_t smhl; - uint64_t ctim; /* any usage? */ uint64_t sttl; unsigned char scid[SCID_LENGTH]; //unsigned char chlo_hash[32]; //SHA256 HASH of CHLO @@ -566,10 +564,6 @@ static int parse_hs_data (lsquic_enc_session_t *enc_session, uint32_t tag, return -1; break; - case QTAG_SRBF: - hs_ctx->srbf = get_tag_value_i32(val, len); - break; - case QTAG_ICSL: hs_ctx->icsl = get_tag_value_i32(val, len); break; @@ -586,10 +580,6 @@ static int parse_hs_data (lsquic_enc_session_t *enc_session, uint32_t tag, /* else ignore, following the reference implementation */ break; - case QTAG_CTIM: - hs_ctx->ctim = get_tag_value_i64(val, len); - break; - case QTAG_SNI: lsquic_str_setto(&hs_ctx->sni, val, len); ESHIST_APPEND(enc_session, ESHE_SET_SNI); @@ -957,7 +947,6 @@ lsquic_enc_session_gen_chlo (lsquic_enc_session_t *enc_session, MSG_LEN_ADD(msg_len, 4); ++n_tags; /* SFCW */ MSG_LEN_ADD(msg_len, 4); ++n_tags; /* ICSL */ MSG_LEN_ADD(msg_len, 4); ++n_tags; /* SMHL */ - MSG_LEN_ADD(msg_len, 8); ++n_tags; /* CTIM */ MSG_LEN_ADD(msg_len, 4); ++n_tags; /* KEXS */ MSG_LEN_ADD(msg_len, 0); ++n_tags; /* CSCT */ if (n_opts > 0) @@ -1023,11 +1012,6 @@ lsquic_enc_session_gen_chlo (lsquic_enc_session_t *enc_session, if (MSG_LEN_VAL(msg_len) > *len) return -1; - /* Calculate any remaining values: */ - enc_session->hs_ctx.ctim = time(NULL); - - /* XXX: should we use MSPC instead of MIDS in newer versions of gQUIC? */ - /* Write CHLO: */ MW_BEGIN(&mw, QTAG_CHLO, n_tags, buf); if (include_pad) @@ -1053,7 +1037,6 @@ lsquic_enc_session_gen_chlo (lsquic_enc_session_t *enc_session, MW_WRITE_UINT32(&mw, QTAG_PDMD, settings->es_pdmd); MW_WRITE_UINT32(&mw, QTAG_SMHL, 1); MW_WRITE_UINT32(&mw, QTAG_ICSL, settings->es_idle_conn_to / 1000000); - MW_WRITE_UINT64(&mw, QTAG_CTIM, enc_session->hs_ctx.ctim); if (lsquic_str_len(&enc_session->info->scfg) > 0 && enc_session->cert_ptr) MW_WRITE_BUFFER(&mw, QTAG_PUBS, pub_key, sizeof(pub_key)); MW_WRITE_UINT32(&mw, QTAG_MIDS, settings->es_max_streams_in); diff --git a/src/liblsquic/lsquic_qtags.h b/src/liblsquic/lsquic_qtags.h index c5aeedb..d81bc75 100644 --- a/src/liblsquic/lsquic_qtags.h +++ b/src/liblsquic/lsquic_qtags.h @@ -14,7 +14,6 @@ #define QTAG_CHLO TAG('C', 'H', 'L', 'O') #define QTAG_COPT TAG('C', 'O', 'P', 'T') #define QTAG_CSCT TAG('C', 'S', 'C', 'T') -#define QTAG_CTIM TAG('C', 'T', 'I', 'M') #define QTAG_EXPY TAG('E', 'X', 'P', 'Y') #define QTAG_ICSL TAG('I', 'C', 'S', 'L') #define QTAG_IRTT TAG('I', 'R', 'T', 'T') @@ -35,7 +34,6 @@ #define QTAG_SFCW TAG('S', 'F', 'C', 'W') #define QTAG_SHLO TAG('S', 'H', 'L', 'O') #define QTAG_SNI TAG('S', 'N', 'I', 0 ) -#define QTAG_SRBF TAG('S', 'R', 'B', 'F') #define QTAG_SREJ TAG('S', 'R', 'E', 'J') #define QTAG_STTL TAG('S', 'T', 'T', 'L') #define QTAG_TCID TAG('T', 'C', 'I', 'D') diff --git a/test/test_common.c b/test/test_common.c index 4aadebc..2550f4f 100644 --- a/test/test_common.c +++ b/test/test_common.c @@ -906,29 +906,10 @@ set_engine_option (struct lsquic_engine_settings *settings, *version_cleared = 1; settings->es_versions = 0; } - if (0 == strcmp(val, "Q035")) + const enum lsquic_version ver = lsquic_str2ver(val, strlen(val)); + if (ver < N_LSQVER) { - settings->es_versions |= 1 << LSQVER_035; - return 0; - } - if (0 == strcmp(val, "Q037")) - { - settings->es_versions |= 1 << LSQVER_037; - return 0; - } - if (0 == strcmp(val, "Q038")) - { - settings->es_versions |= 1 << LSQVER_038; - return 0; - } - if (0 == strcmp(val, "Q039")) - { - settings->es_versions |= 1 << LSQVER_039; - return 0; - } - if (0 == strcmp(val, "Q041")) - { - settings->es_versions |= 1 << LSQVER_041; + settings->es_versions |= 1 << ver; return 0; } }