Skip to content

Commit

Permalink
Fix session print for dtls1.3
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #22936)
  • Loading branch information
fwh-dc authored and mattcaswell committed Apr 23, 2024
1 parent 988952d commit 553fcfb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ssl/ssl_txt.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,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);
Expand Down Expand Up @@ -72,7 +73,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)
Expand Down Expand Up @@ -151,7 +152,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;
Expand Down

0 comments on commit 553fcfb

Please sign in to comment.