summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-09-08 13:42:53 +0100
committerHugo Landau <hlandau@openssl.org>2024-02-02 11:49:34 +0000
commitfb1a0bb97aa630cd303d9c7c30214483538a57f6 (patch)
tree201036a356ab55fe4b8f89fdb581131584013b11 /ssl
parent407bcc8d55c06d556a1026aa83c62f10f923ebb2 (diff)
QLOG: Wire title-setting code to QUIC_CHANNEL and SSL_CTX
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22037)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/quic/quic_channel_local.h2
-rw-r--r--ssl/quic/quic_impl.c17
-rw-r--r--ssl/ssl_lib.c3
-rw-r--r--ssl/ssl_local.h4
4 files changed, 25 insertions, 1 deletions
diff --git a/ssl/quic/quic_channel_local.h b/ssl/quic/quic_channel_local.h
index 4cd4dd84b7..564b789f9c 100644
--- a/ssl/quic/quic_channel_local.h
+++ b/ssl/quic/quic_channel_local.h
@@ -439,7 +439,7 @@ struct quic_channel_st {
size_t num_ack_range_scratch;
/* Title for QLOG purposes. We own this copy. */
- char *quic_channel_local;
+ char *qlog_title;
};
# endif
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c
index 1248013a4b..7c0d2c65b7 100644
--- a/ssl/quic/quic_impl.c
+++ b/ssl/quic/quic_impl.c
@@ -1510,6 +1510,7 @@ static int create_channel(QUIC_CONNECTION *qc)
}
#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;
@@ -3705,3 +3706,19 @@ QUIC_CHANNEL *ossl_quic_conn_get_channel(SSL *s)
return ctx.qc->ch;
}
+
+int ossl_quic_set_diag_title(SSL_CTX *ctx, const char *title)
+{
+#ifndef OPENSSL_NO_QLOG
+ OPENSSL_free(ctx->qlog_title);
+ ctx->qlog_title = NULL;
+
+ if (title == NULL)
+ return 1;
+
+ if ((ctx->qlog_title = OPENSSL_strdup(title)) == NULL)
+ return 0;
+#endif
+
+ return 1;
+}
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 71a39a1005..6788d2c104 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -4214,6 +4214,9 @@ void SSL_CTX_free(SSL_CTX *a)
#endif
OPENSSL_free(a->propq);
+#ifndef OPENSSL_NO_QLOG
+ OPENSSL_free(a->qlog_title);
+#endif
OPENSSL_free(a);
}
diff --git a/ssl/ssl_local.h b/ssl/ssl_local.h
index 211b72c6fe..1db5df46df 100644
--- a/ssl/ssl_local.h
+++ b/ssl/ssl_local.h
@@ -1189,6 +1189,10 @@ struct ssl_ctx_st {
size_t client_cert_type_len;
unsigned char *server_cert_type;
size_t server_cert_type_len;
+
+# ifndef OPENSSL_NO_QLOG
+ char *qlog_title; /* Session title for QLOG */
+# endif
};
typedef struct cert_pkey_st CERT_PKEY;