Skip to content

Commit

Permalink
Release 2.29.0
Browse files Browse the repository at this point in the history
- [FEATURE] QUIC and HTTP/3 Internet Draft 34 support and v1 support.
  The latter is turned off by default.
- Drop support for ID-28 and ID-32.
- [BUGFIX] IETF QUIC mini conn receive history (trechist): allow
  unlimited inserts by dropping smallest elements.
- [BUGFIX] gQUIC: set STTL to correct value, issue #226.
- [BUGFIX] Account for poison packet gap when MTU probe was too large.
  • Loading branch information
Dmitri Tikhonov committed Feb 10, 2021
1 parent ac0ce07 commit 26e8f08
Show file tree
Hide file tree
Showing 29 changed files with 386 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ task:
- cd boringssl
# This is so that both GQUIC and IETF branches build. Just picking
# a known good revision:
- git checkout b117a3a0b7bd11fe6ebd503ec6b45d6b910b41a1
- git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9
- cmake .
- make
- cd -
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ before_script:
- cd boringssl
# This is so that both GQUIC and IETF branches build. Just picking
# a known good revision:
- git checkout b117a3a0b7bd11fe6ebd503ec6b45d6b910b41a1
- git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9
- cmake .
- make
- cd -
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2021-02-10
- 2.29.0
- [FEATURE] QUIC and HTTP/3 Internet Draft 34 support and v1 support.
The latter is turned off by default.
- Drop support for ID-28 and ID-32.
- [BUGFIX] IETF QUIC mini conn receive history (trechist): allow
unlimited inserts by dropping smallest elements.
- [BUGFIX] gQUIC: set STTL to correct value, issue #226.
- [BUGFIX] Account for poison packet gap when MTU probe was too large.

2021-02-03
- 2.28.0
- [API] lsquic_ssl_sess_to_resume_info() is the new way to get
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ COPY ./ /src/lsquic/

RUN git clone https://boringssl.googlesource.com/boringssl && \
cd boringssl && \
git checkout b117a3a0b7bd11fe6ebd503ec6b45d6b910b41a1 && \
git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9 && \
cmake . && \
make

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ and HTTP/3 functionality for servers and clients. Most of the code in this
distribution is used in our own products: LiteSpeed Web Server, LiteSpeed ADC,
and OpenLiteSpeed.

Currently supported QUIC versions are Q043, Q046, Q050, ID-27, ID-28, ID-29,
and ID-32. Support for newer versions is added soon after they are released.
Currently supported QUIC versions are v1 (disabled by default until the
QUIC RFC is released); Internet-Draft versions 34, 29, and 27;
and the older "Google" QUIC versions Q043, Q046, an Q050.

Documentation
-------------
Expand Down Expand Up @@ -48,7 +49,7 @@ You may need to install pre-requisites like zlib and libevent.
2. Use specific BoringSSL version

```
git checkout b117a3a0b7bd11fe6ebd503ec6b45d6b910b41a1
git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9
```

3. Compile the library
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ build_script:
cd boringssl
git checkout b117a3a0b7bd11fe6ebd503ec6b45d6b910b41a1
git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9
cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=OFF -DOPENSSL_NO_ASM=1 .
Expand Down
13 changes: 7 additions & 6 deletions docs/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,18 @@ developed by the IETF. Both types are included in a single enum:

IETF QUIC version ID (Internet-Draft) 27; this version is deprecated.

.. member:: LSQVER_ID28

IETF QUIC version ID 28; this version is deprecated.

.. member:: LSQVER_ID29

IETF QUIC version ID 29

.. member:: LSQVER_ID32
.. member:: LSQVER_ID34

IETF QUIC version ID 34

.. member:: LSQVER_I001

IETF QUIC version ID 32
IETF QUIC version 1. (This version is disabled by default until
the QUIC RFC is released).

.. member:: N_LSQVER

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
author = u'LiteSpeed Technologies'

# The short X.Y version
version = u'2.28'
version = u'2.29'
# The full version, including alpha/beta/rc tags
release = u'2.28.0'
release = u'2.29.0'


# -- General configuration ---------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Most of the code in this distribution has been used in our own products
-- `LiteSpeed Web Server`_, `LiteSpeed Web ADC`_, and OpenLiteSpeed_ --
since 2017.

Currently supported QUIC versions are Q043, Q046, Q050, ID-27, ID-28,
ID-29, and ID-32.
Support for newer versions will be added soon after they are released.
Currently supported QUIC versions are v1 (disabled by default until the
QUIC RFC is released); Internet-Draft versions 34, 29, and 27;
and the older "Google" QUIC versions Q043, Q046, an Q050.

LSQUIC is licensed under the `MIT License`_; see LICENSE in the source
distribution for details.
Expand Down
31 changes: 17 additions & 14 deletions include/lsquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern "C" {
#endif

#define LSQUIC_MAJOR_VERSION 2
#define LSQUIC_MINOR_VERSION 28
#define LSQUIC_MINOR_VERSION 29
#define LSQUIC_PATCH_VERSION 0

/**
Expand Down Expand Up @@ -82,19 +82,20 @@ enum lsquic_version
LSQVER_ID27,

/**
* IETF QUIC Draft-28; this version is deprecated.
* IETF QUIC Draft-29
*/
LSQVER_ID28,
LSQVER_ID29,

/**
* IETF QUIC Draft-29
* IETF QUIC Draft-34
*/
LSQVER_ID29,
LSQVER_ID34,

/**
* IETF QUIC Draft-32
* IETF QUIC v1. Functionally the same as Draft-34, but marked
* experimental for now.
*/
LSQVER_ID32,
LSQVER_I001,

/**
* Special version to trigger version negotiation.
Expand All @@ -106,8 +107,8 @@ enum lsquic_version
};

/**
* We currently support versions 43, 46, 50, Draft-27, Draft-28, Draft-29,
* and Draft-32.
* We currently support versions 43, 46, 50, Draft-27, Draft-29, Draft-34,
* and IETF QUIC v1.
* @see lsquic_version
*/
#define LSQUIC_SUPPORTED_VERSIONS ((1 << N_LSQVER) - 1)
Expand All @@ -118,19 +119,21 @@ enum lsquic_version
#define LSQUIC_FORCED_TCID0_VERSIONS ((1 << LSQVER_046)|(1 << LSQVER_050))

#define LSQUIC_EXPERIMENTAL_VERSIONS ( \
(1 << LSQVER_I001) | \
(1 << LSQVER_VERNEG) | LSQUIC_EXPERIMENTAL_Q098)

#define LSQUIC_DEPRECATED_VERSIONS ((1 << LSQVER_ID27) | (1 << LSQVER_ID28))
#define LSQUIC_DEPRECATED_VERSIONS ((1 << LSQVER_ID27))

#define LSQUIC_GQUIC_HEADER_VERSIONS (1 << LSQVER_043)

#define LSQUIC_IETF_VERSIONS ((1 << LSQVER_ID27) | (1 << LSQVER_ID28) \
#define LSQUIC_IETF_VERSIONS ((1 << LSQVER_ID27) \
| (1 << LSQVER_ID29) \
| (1 << LSQVER_ID32) | (1 << LSQVER_VERNEG))
| (1 << LSQVER_ID34) \
| (1 << LSQVER_I001) | (1 << LSQVER_VERNEG))

#define LSQUIC_IETF_DRAFT_VERSIONS ((1 << LSQVER_ID27) | (1 << LSQVER_ID28) \
#define LSQUIC_IETF_DRAFT_VERSIONS ((1 << LSQVER_ID27) \
| (1 << LSQVER_ID29) \
| (1 << LSQVER_ID32) | (1 << LSQVER_VERNEG))
| (1 << LSQVER_ID34) | (1 << LSQVER_VERNEG))

enum lsquic_hsk_status
{
Expand Down
6 changes: 6 additions & 0 deletions src/liblsquic/gen-verstrs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
push @all_versions, $1;
push @all_alpns, "h3-$2";
}
if (/^\s*(LSQVER_I(\d{3}))\b/) {
push @all_versions, $1;
if (not grep 'h3' eq $_, @all_alpns) {
push @all_alpns, "h3";
}
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/liblsquic/lsquic_enc_sess.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ extern const struct enc_session_funcs_iquic lsquic_enc_session_iquic_ietf_v1;

#define select_esf_common_by_ver(ver) ( \
ver == LSQVER_ID27 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_ID28 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_ID29 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_ID32 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_ID34 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_I001 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_VERNEG ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_050 ? &lsquic_enc_session_common_gquic_2 : \
&lsquic_enc_session_common_gquic_1 )
Expand Down
31 changes: 25 additions & 6 deletions src/liblsquic/lsquic_enc_sess_ietf.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ static const struct alpn_map {
const unsigned char *alpn;
} s_h3_alpns[] = {
{ LSQVER_ID27, (unsigned char *) "\x05h3-27", },
{ LSQVER_ID28, (unsigned char *) "\x05h3-28", },
{ LSQVER_ID29, (unsigned char *) "\x05h3-29", },
{ LSQVER_ID32, (unsigned char *) "\x05h3-32", },
{ LSQVER_VERNEG, (unsigned char *) "\x05h3-32", },
{ LSQVER_ID34, (unsigned char *) "\x05h3-34", },
{ LSQVER_I001, (unsigned char *) "\x02h3", },
{ LSQVER_VERNEG, (unsigned char *) "\x05h3-34", },
};

struct enc_sess_iquic;
Expand Down Expand Up @@ -926,6 +926,10 @@ iquic_esfi_create_client (const char *hostname,
ERR_error_string(ERR_get_error(), errbuf));
goto err;
}
#if BORINGSSL_API_VERSION >= 13
SSL_set_quic_use_legacy_codepoint(enc_sess->esi_ssl,
enc_sess->esi_ver_neg->vn_ver < LSQVER_ID34);
#endif

transpa_len = gen_trans_params(enc_sess, trans_params,
sizeof(trans_params));
Expand Down Expand Up @@ -1109,6 +1113,7 @@ setup_handshake_keys (struct enc_sess_iquic *enc_sess, const lsquic_cid_t *cid)
struct header_prot *hp;
size_t hsk_secret_sz, key_len;
unsigned cliser, i;
const unsigned char *salt;
unsigned char hsk_secret[EVP_MAX_MD_SIZE];
unsigned char secret[2][SHA256_DIGEST_LENGTH]; /* client, server */
unsigned char key[2][EVP_MAX_KEY_LENGTH];
Expand All @@ -1131,12 +1136,17 @@ setup_handshake_keys (struct enc_sess_iquic *enc_sess, const lsquic_cid_t *cid)
pair->ykp_thresh = IQUIC_INVALID_PACKNO;
hp = &enc_sess->esi_hsk_hps[ENC_LEV_CLEAR];

if (enc_sess->esi_conn->cn_version < LSQVER_ID29)
salt = HSK_SALT_PRE29;
else if (enc_sess->esi_conn->cn_version < LSQVER_ID34)
salt = HSK_SALT_PRE33;
else
salt = HSK_SALT;
HKDF_extract(hsk_secret, &hsk_secret_sz, md, cid->idbuf, cid->len,
enc_sess->esi_conn->cn_version < LSQVER_ID29
? HSK_SALT_PRE29 : HSK_SALT, HSK_SALT_SZ);
salt, HSK_SALT_SZ);
if (enc_sess->esi_flags & ESI_LOG_SECRETS)
{
LSQ_DEBUG("handshake salt: %s", HEXSTR(HSK_SALT, HSK_SALT_SZ, hexbuf));
LSQ_DEBUG("handshake salt: %s", HEXSTR(salt, HSK_SALT_SZ, hexbuf));
LSQ_DEBUG("handshake secret: %s", HEXSTR(hsk_secret, hsk_secret_sz,
hexbuf));
}
Expand Down Expand Up @@ -1382,6 +1392,10 @@ iquic_esfi_init_server (enc_session_t *enc_session_p)
ERR_error_string(ERR_get_error(), u.errbuf));
return -1;
}
#if BORINGSSL_API_VERSION >= 13
SSL_set_quic_use_legacy_codepoint(enc_sess->esi_ssl,
enc_sess->esi_conn->cn_version < LSQVER_ID34);
#endif
if (!(SSL_set_quic_method(enc_sess->esi_ssl, &cry_quic_method)))
{
LSQ_INFO("could not set stream method");
Expand Down Expand Up @@ -3327,6 +3341,9 @@ const unsigned char *const lsquic_retry_key_buf[N_IETF_RETRY_VERSIONS] =
/* [draft-ietf-quic-tls-29] Section 5.8 */
(unsigned char *)
"\xcc\xce\x18\x7e\xd0\x9a\x09\xd0\x57\x28\x15\x5a\x6c\xb9\x6b\xe1",
/* [draft-ietf-quic-tls-33] Section 5.8 */
(unsigned char *)
"\xbe\x0c\x69\x0b\x9f\x66\x57\x5a\x1d\x76\x6b\x54\xe3\x68\xc8\x4e",
};


Expand All @@ -3336,6 +3353,8 @@ const unsigned char *const lsquic_retry_nonce_buf[N_IETF_RETRY_VERSIONS] =
(unsigned char *) "\x4d\x16\x11\xd0\x55\x13\xa5\x52\xc5\x87\xd5\x75",
/* [draft-ietf-quic-tls-29] Section 5.8 */
(unsigned char *) "\xe5\x49\x30\xf9\x7f\x21\x36\xf0\x53\x0a\x8c\x1c",
/* [draft-ietf-quic-tls-33] Section 5.8 */
(unsigned char *) "\x46\x15\x99\xd3\x5d\x63\x2b\xf2\x23\x98\x25\xbb",
};


Expand Down
2 changes: 1 addition & 1 deletion src/liblsquic/lsquic_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ lsquic_engine_new (unsigned flags,
{
int sz = lsquic_enc_sess_ietf_gen_quic_ctx(
&engine->pub.enp_settings,
i == 0 ? LSQVER_ID27 : LSQVER_ID28,
i == 0 ? LSQVER_ID27 : LSQVER_ID29,
engine->pub.enp_quic_ctx_buf[i],
sizeof(engine->pub.enp_quic_ctx_buf));
if (sz < 0)
Expand Down
Loading

0 comments on commit 26e8f08

Please sign in to comment.