From dfacc34b5531758fbd9129e03771aa661e80e93e Mon Sep 17 00:00:00 2001 From: jsing <> Date: Thu, 23 Jan 2020 05:08:30 +0000 Subject: Implement pending for TLSv1.3. Makes `openssl s_client -peekaboo` work with TLSv1.3. ok beck@ tb@ --- src/lib/libssl/tls13_lib.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl/tls13_lib.c') diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c index 727f617471..de3e840a84 100644 --- a/src/lib/libssl/tls13_lib.c +++ b/src/lib/libssl/tls13_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_lib.c,v 1.22 2020/01/23 02:49:38 jsing Exp $ */ +/* $OpenBSD: tls13_lib.c,v 1.23 2020/01/23 05:08:30 jsing Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing * Copyright (c) 2019 Bob Beck @@ -410,6 +410,22 @@ tls13_legacy_return_code(SSL *ssl, ssize_t ret) return -1; } +int +tls13_legacy_pending(const SSL *ssl) +{ + struct tls13_ctx *ctx = ssl->internal->tls13; + ssize_t ret; + + if (ctx == NULL) + return 0; + + ret = tls13_pending_application_data(ctx->rl); + if (ret < 0 || ret > INT_MAX) + return 0; + + return ret; +} + int tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, int peek) { -- cgit v1.2.3-55-g6feb