Release 2.29.2

- Fix regression in gQUIC server: bug #234.
This commit is contained in:
Dmitri Tikhonov 2021-02-23 12:18:50 -05:00
parent 8ecb980d26
commit f1d5a1a4de
4 changed files with 27 additions and 11 deletions

View file

@ -1,3 +1,7 @@
2021-02-23
- 2.29.2
- Fix regression in gQUIC server: bug #234.
2021-02-18 2021-02-18
- 2.29.1 - 2.29.1
- Make it possible to build the library and unit tests without - Make it possible to build the library and unit tests without

View file

@ -26,7 +26,7 @@ author = u'LiteSpeed Technologies'
# The short X.Y version # The short X.Y version
version = u'2.29' version = u'2.29'
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
release = u'2.29.1' release = u'2.29.2'
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------

View file

@ -25,7 +25,7 @@ extern "C" {
#define LSQUIC_MAJOR_VERSION 2 #define LSQUIC_MAJOR_VERSION 2
#define LSQUIC_MINOR_VERSION 29 #define LSQUIC_MINOR_VERSION 29
#define LSQUIC_PATCH_VERSION 1 #define LSQUIC_PATCH_VERSION 2
/** /**
* Engine flags: * Engine flags:

View file

@ -1887,7 +1887,7 @@ get_valid_scfg (const struct lsquic_enc_session *enc_session,
static int static int
generate_crt (struct lsquic_enc_session *enc_session) generate_crt (struct lsquic_enc_session *enc_session, int common_case)
{ {
int i, n, len, crt_num, rv = -1; int i, n, len, crt_num, rv = -1;
lsquic_str_t **crts; lsquic_str_t **crts;
@ -1926,13 +1926,16 @@ generate_crt (struct lsquic_enc_session *enc_session)
if (!ccert) if (!ccert)
goto cleanup; goto cleanup;
if (SSL_CTX_set_ex_data(ctx, s_ccrt_idx, ccert)) if (common_case)
++ccert->refcnt;
else
{ {
free(ccert); if (SSL_CTX_set_ex_data(ctx, s_ccrt_idx, ccert))
ccert = NULL; ++ccert->refcnt;
goto cleanup; else
{
free(ccert);
ccert = NULL;
goto cleanup;
}
} }
++ccert->refcnt; ++ccert->refcnt;
@ -1966,6 +1969,7 @@ gen_rej1_data (struct lsquic_enc_session *enc_session, uint8_t *data,
hs_ctx_t *const hs_ctx = &enc_session->hs_ctx; hs_ctx_t *const hs_ctx = &enc_session->hs_ctx;
int scfg_len = enc_session->server_config->lsc_scfg->info.scfg_len; int scfg_len = enc_session->server_config->lsc_scfg->info.scfg_len;
uint8_t *scfg_data = enc_session->server_config->lsc_scfg->scfg; uint8_t *scfg_data = enc_session->server_config->lsc_scfg->scfg;
int common_case;
size_t msg_len; size_t msg_len;
struct message_writer mw; struct message_writer mw;
uint64_t sttl; uint64_t sttl;
@ -1989,13 +1993,21 @@ gen_rej1_data (struct lsquic_enc_session *enc_session, uint8_t *data,
hs_ctx->ccert = NULL; hs_ctx->ccert = NULL;
} }
hs_ctx->ccert = SSL_CTX_get_ex_data(ctx, s_ccrt_idx); /**
* Only cache hs_ctx->ccs is the hardcoded common certs and hs_ctx->ccrt is empty case
* This is the most common case
*/
common_case = lsquic_str_len(&hs_ctx->ccrt) == 0
&& lsquic_str_bcmp(&hs_ctx->ccs, lsquic_get_common_certs_hash()) == 0;
if (common_case)
hs_ctx->ccert = SSL_CTX_get_ex_data(ctx, s_ccrt_idx);
if (hs_ctx->ccert) if (hs_ctx->ccert)
{ {
++hs_ctx->ccert->refcnt; ++hs_ctx->ccert->refcnt;
LSQ_DEBUG("use cached compressed cert"); LSQ_DEBUG("use cached compressed cert");
} }
else if (0 == generate_crt(enc_session)) else if (0 == generate_crt(enc_session, common_case))
LSQ_DEBUG("generated compressed cert"); LSQ_DEBUG("generated compressed cert");
else else
{ {