summaryrefslogtreecommitdiff
path: root/ssl/ssl_txt.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-06-25 17:52:01 +0100
committerMatt Caswell <matt@openssl.org>2018-06-26 10:07:01 +0100
commit32f803d88ec3df7f95dfbf840c271f7438ce3357 (patch)
tree3dad9686c08158e11afddd474ab7fd2a4d6d980a /ssl/ssl_txt.c
parent20c0bce50654b5dfa70d8cec4fed719b3cce65fb (diff)
downloadopenssl-new-32f803d88ec3df7f95dfbf840c271f7438ce3357.tar.gz
Update SSL_SESSION_print for TLSv1.3
Make SSL_SESSION_print() show a bit more information for TLSv1.3 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6590)
Diffstat (limited to 'ssl/ssl_txt.c')
-rw-r--r--ssl/ssl_txt.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ssl/ssl_txt.c b/ssl/ssl_txt.c
index fdaf21eec7..3856491eca 100644
--- a/ssl/ssl_txt.c
+++ b/ssl/ssl_txt.c
@@ -33,6 +33,7 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
{
size_t i;
const char *s;
+ int istls13 = (x->ssl_version == TLS1_3_VERSION);
if (x == NULL)
goto err;
@@ -70,7 +71,10 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
if (BIO_printf(bp, "%02X", x->sid_ctx[i]) <= 0)
goto err;
}
- if (BIO_puts(bp, "\n Master-Key: ") <= 0)
+ if (istls13) {
+ if (BIO_puts(bp, "\n Resumption PSK: ") <= 0)
+ goto err;
+ } else if (BIO_puts(bp, "\n Master-Key: ") <= 0)
goto err;
for (i = 0; i < x->master_key_length; i++) {
if (BIO_printf(bp, "%02X", x->master_key[i]) <= 0)
@@ -145,6 +149,12 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
x->flags & SSL_SESS_FLAG_EXTMS ? "yes" : "no") <= 0)
goto err;
+ if (istls13) {
+ if (BIO_printf(bp, " Max Early Data: %u\n",
+ x->ext.max_early_data) <= 0)
+ goto err;
+ }
+
return 1;
err:
return 0;