diff options
author | 2020-01-23 05:08:30 +0000 | |
---|---|---|
committer | 2020-01-23 05:08:30 +0000 | |
commit | 7003a9ccf9b2c90d12adb857fcb34e53b53c9868 (patch) | |
tree | e5311207ff5994aaa6f15c9c318f8c2fef1b02c8 /lib/libssl/tls13_lib.c | |
parent | missing header change from previous; spotted by dtucker@ (diff) | |
download | wireguard-openbsd-7003a9ccf9b2c90d12adb857fcb34e53b53c9868.tar.xz wireguard-openbsd-7003a9ccf9b2c90d12adb857fcb34e53b53c9868.zip |
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; |