diff options
author | Matt Caswell <matt@openssl.org> | 2023-05-02 14:26:47 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2023-05-24 13:18:27 +0200 |
commit | 45aac10717479b5c2445e7704cd742b0d754aaa8 (patch) | |
tree | e7c702d752d132ad27e3440d43458ffc9095861c /ssl/t1_trce.c | |
parent | Add initial QUIC support for the msg_callback (diff) | |
download | openssl-45aac10717479b5c2445e7704cd742b0d754aaa8.tar.xz openssl-45aac10717479b5c2445e7704cd742b0d754aaa8.zip |
Support trace for QUIC datagrams
Extend SSL_trace so that it knows how to dump information about the
receipt of a QUIC datagram.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20914)
Diffstat (limited to 'ssl/t1_trce.c')
-rw-r--r-- | ssl/t1_trce.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ssl/t1_trce.c b/ssl/t1_trce.c index 8d66bf51dd..7776a0bea1 100644 --- a/ssl/t1_trce.c +++ b/ssl/t1_trce.c @@ -1702,6 +1702,19 @@ void SSL_trace(int write_p, int version, int content_type, const unsigned char *msg = buf; BIO *bio = arg; SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); +#ifndef OPENSSL_NO_QUIC + QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_SSL(ssl); + + if (qc != NULL) { + if (ossl_quic_trace(write_p, version, content_type, buf, msglen, ssl, + arg)) + return; + /* + * Otherwise ossl_quic_trace didn't handle this content_type so we + * fallback to standard TLS handling + */ + } +#endif if (sc == NULL) return; @@ -1720,7 +1733,7 @@ void SSL_trace(int write_p, int version, int content_type, } hvers = msg[1] << 8 | msg[2]; BIO_puts(bio, write_p ? "Sent" : "Received"); - BIO_printf(bio, " Record\nHeader:\n Version = %s (0x%x)\n", + BIO_printf(bio, " TLS Record\nHeader:\n Version = %s (0x%x)\n", ssl_trace_str(hvers, ssl_version_tbl), hvers); if (SSL_CONNECTION_IS_DTLS(sc)) { BIO_printf(bio, |