]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix session print for dtls1.3
authorFrederik Wedel-Heinen <frederik.wedel-heinen@dencrypt.dk>
Mon, 16 Oct 2023 07:57:00 +0000 (09:57 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 9 Jan 2025 16:02:19 +0000 (17:02 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22936)

ssl/ssl_txt.c

index d928cb9bbd6faa7822578acf97c0f2d672cfb420..7f7af8a53a2d468246b5648314885b766bfbc2e4 100644 (file)
@@ -35,11 +35,12 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
 {
     size_t i;
     const char *s;
-    int istls13;
+    int isversion13;
 
     if (x == NULL)
         goto err;
-    istls13 = (x->ssl_version == TLS1_3_VERSION);
+    isversion13 = (x->ssl_version == TLS1_3_VERSION)
+                  || (x->ssl_version == DTLS1_3_VERSION);
     if (BIO_puts(bp, "SSL-Session:\n") <= 0)
         goto err;
     s = ssl_protocol_to_string(x->ssl_version);
@@ -74,7 +75,7 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
         if (BIO_printf(bp, "%02X", x->sid_ctx[i]) <= 0)
             goto err;
     }
-    if (istls13) {
+    if (isversion13) {
         if (BIO_puts(bp, "\n    Resumption PSK: ") <= 0)
             goto err;
     } else if (BIO_puts(bp, "\n    Master-Key: ") <= 0)
@@ -153,7 +154,7 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
                    x->flags & SSL_SESS_FLAG_EXTMS ? "yes" : "no") <= 0)
         goto err;
 
-    if (istls13) {
+    if (isversion13) {
         if (BIO_printf(bp, "    Max Early Data: %u\n",
                        (unsigned int)x->ext.max_early_data) <= 0)
             goto err;