diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2020-01-23 05:08:31 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2020-01-23 05:08:31 +0000 |
commit | 83911a0cf9ebdba2116f0f04c152a4223f77dbc8 (patch) | |
tree | deee86b200733c62abda12f831415813681e9508 /lib/libssl/tls13_lib.c | |
parent | dec3580b0de9ea03ecebb1fc02faa58828418f0a (diff) |
Implement pending for TLSv1.3.
Makes `openssl s_client -peekaboo` work with TLSv1.3.
ok beck@ tb@
Diffstat (limited to 'lib/libssl/tls13_lib.c')
-rw-r--r-- | lib/libssl/tls13_lib.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/libssl/tls13_lib.c b/lib/libssl/tls13_lib.c index 727f617471c..de3e840a84f 100644 --- a/lib/libssl/tls13_lib.c +++ b/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 <jsing@openbsd.org> * Copyright (c) 2019 Bob Beck <beck@openbsd.org> @@ -411,6 +411,22 @@ tls13_legacy_return_code(SSL *ssl, ssize_t ret) } 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) { struct tls13_ctx *ctx = ssl->internal->tls13; |