From: Hugo Landau Date: Wed, 10 Jan 2024 08:29:28 +0000 (+0000) Subject: QLOG: Minor fixes after port refactor X-Git-Tag: openssl-3.3.0-alpha1~209 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43a128875d8fe26aec35aef093d78fbcd06fd1ca;p=thirdparty%2Fopenssl.git QLOG: Minor fixes after port refactor Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/22037) --- diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index b76f825d0e7..ea6a7681856 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -117,6 +117,9 @@ static QLOG *ch_get_qlog(QUIC_CHANNEL *ch) if (!ch->use_qlog) return NULL; + if (ch->is_server && ch->init_dcid.id_len == 0) + return NULL; + qti.odcid = ch->init_dcid; qti.title = ch->qlog_title; qti.description = NULL; diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 7c0d2c65b77..6261075b769 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -1508,10 +1508,6 @@ static int create_channel(QUIC_CONNECTION *qc) QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_INTERNAL_ERROR, NULL); return 0; } -#ifndef OPENSSL_NO_QLOG - args.use_qlog = 1; /* disabled if env not set */ - args.qlog_title = qc->ssl.ctx->qlog_title; -#endif port_args.channel_ctx = qc->ssl.ctx; qc->port = ossl_quic_engine_create_port(qc->engine, &port_args); diff --git a/ssl/quic/quic_port.c b/ssl/quic/quic_port.c index 0de384de454..f40d5855e35 100644 --- a/ssl/quic/quic_port.c +++ b/ssl/quic/quic_port.c @@ -316,6 +316,11 @@ static QUIC_CHANNEL *port_make_channel(QUIC_PORT *port, SSL *tls, int is_server) if (args.tls == NULL) return NULL; +#ifndef OPENSSL_NO_QLOG + args.use_qlog = 1; /* disabled if env not set */ + args.qlog_title = args.tls->ctx->qlog_title; +#endif + ch = ossl_quic_channel_new(&args); if (ch == NULL) { if (tls == NULL) diff --git a/test/build.info b/test/build.info index 672dde588a7..00758cc850e 100644 --- a/test/build.info +++ b/test/build.info @@ -885,7 +885,7 @@ IF[{- !$disabled{tests} -}] ENDIF IF[{- !$disabled{qlog} -}] - SOURCE[json_test]=json_test.c helpers/ssltestlib.c helpers/quictestlib.c + SOURCE[json_test]=json_test.c helpers/ssltestlib.c $QUICTESTHELPERS INCLUDE[json_test]=../include ../apps/include DEPEND[json_test]=../libcrypto.a ../libssl.a libtestutil.a ENDIF