summaryrefslogtreecommitdiffstats
path: root/apps/s_server.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-11-14 14:21:13 +0000
committerMatt Caswell <matt@openssl.org>2017-11-21 17:46:22 +0000
commit3b5873567d24bf0d8bc2a175848e716e295d6c94 (patch)
treedbbc51d592a170c627463bb681d761e2a193c980 /apps/s_server.c
parentbfab12bb7dbd32cb13a8d518f312857ebd045541 (diff)
Provide a more information early_data message in s_server
s_server reported early_data not being sent and early_data being rejected in the same way, i.e. "No early data received". This is slightly misleading so this commit provides a different error message if the early data is rejected. Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/4738)
Diffstat (limited to 'apps/s_server.c')
-rw-r--r--apps/s_server.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/s_server.c b/apps/s_server.c
index 86fed6f593..5095bab4d3 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -2340,10 +2340,14 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
(void)BIO_flush(bio_s_out);
}
}
- if (write_header)
- BIO_printf(bio_s_out, "No early data received\n");
- else
+ if (write_header) {
+ if (SSL_get_early_data_status(con) == SSL_EARLY_DATA_NOT_SENT)
+ BIO_printf(bio_s_out, "No early data received\n");
+ else
+ BIO_printf(bio_s_out, "Early data was rejected\n");
+ } else {
BIO_printf(bio_s_out, "\nEnd of early data\n");
+ }
if (SSL_is_init_finished(con))
print_connection_info(con);
}