Skip to content

Commit

Permalink
Fix session print for dtls1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fwh-dc committed Oct 16, 2023
1 parent 832ba8c commit c3543d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ssl/ssl_txt.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
size_t i;
const char *s;
int istls13;
int isdtls13;

if (x == NULL)
goto err;
istls13 = (x->ssl_version == TLS1_3_VERSION);
isdtls13 = (x->ssl_version == DTLS1_3_VERSION);
if (BIO_puts(bp, "SSL-Session:\n") <= 0)
goto err;
s = ssl_protocol_to_string(x->ssl_version);
Expand Down Expand Up @@ -72,7 +74,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 (istls13 || isdtls13) {
if (BIO_puts(bp, "\n Resumption PSK: ") <= 0)
goto err;
} else if (BIO_puts(bp, "\n Master-Key: ") <= 0)
Expand Down Expand Up @@ -151,7 +153,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 (istls13 || isdtls13) {
if (BIO_printf(bp, " Max Early Data: %u\n",
(unsigned int)x->ext.max_early_data) <= 0)
goto err;
Expand Down

0 comments on commit c3543d6

Please sign in to comment.