QLOG: Minor fixes after port refactor
authorHugo Landau <hlandau@openssl.org>
Wed, 10 Jan 2024 08:29:28 +0000 (08:29 +0000)
committerHugo Landau <hlandau@openssl.org>
Fri, 2 Feb 2024 11:49:34 +0000 (11:49 +0000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22037)

ssl/quic/quic_channel.c
ssl/quic/quic_impl.c
ssl/quic/quic_port.c
test/build.info

index b76f825d0e7d5504fa9bc3f0f9a739a66b3ca795..ea6a76818566485c59ddf4b83461742c9fa7de7e 100644 (file)
@@ -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;
index 7c0d2c65b776114f82f9f235d61f892bf98c1789..6261075b7691aff0b503c023d35e88ceed7934f7 100644 (file)
@@ -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);
index 0de384de454e877741bec8e158797d4d710c1a53..f40d5855e352cbaf16322173dc8885d2f470a9b1 100644 (file)
@@ -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)
index 672dde588a702a4a5801922fc67f9f9697d43775..00758cc850e340760ed3269590e678c4e2a18ec6 100644 (file)
@@ -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