summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_lib.c
diff options
context:
space:
mode:
authorjsing <>2020-01-23 05:08:30 +0000
committerjsing <>2020-01-23 05:08:30 +0000
commitdfacc34b5531758fbd9129e03771aa661e80e93e (patch)
tree0dfc13f3d289553240cc670163ecbf18a368b4ee /src/lib/libssl/tls13_lib.c
parent130f32cc7004f9434c10db4fc8a7e8b1db9082a5 (diff)
downloadopenbsd-dfacc34b5531758fbd9129e03771aa661e80e93e.tar.gz
openbsd-dfacc34b5531758fbd9129e03771aa661e80e93e.tar.bz2
openbsd-dfacc34b5531758fbd9129e03771aa661e80e93e.zip
Implement pending for TLSv1.3.
Makes `openssl s_client -peekaboo` work with TLSv1.3. ok beck@ tb@
Diffstat (limited to 'src/lib/libssl/tls13_lib.c')
-rw-r--r--src/lib/libssl/tls13_lib.c18
1 files changed, 17 insertions, 1 deletions
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 @@
1/* $OpenBSD: tls13_lib.c,v 1.22 2020/01/23 02:49:38 jsing Exp $ */ 1/* $OpenBSD: tls13_lib.c,v 1.23 2020/01/23 05:08:30 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2019 Bob Beck <beck@openbsd.org> 4 * Copyright (c) 2019 Bob Beck <beck@openbsd.org>
@@ -411,6 +411,22 @@ tls13_legacy_return_code(SSL *ssl, ssize_t ret)
411} 411}
412 412
413int 413int
414tls13_legacy_pending(const SSL *ssl)
415{
416 struct tls13_ctx *ctx = ssl->internal->tls13;
417 ssize_t ret;
418
419 if (ctx == NULL)
420 return 0;
421
422 ret = tls13_pending_application_data(ctx->rl);
423 if (ret < 0 || ret > INT_MAX)
424 return 0;
425
426 return ret;
427}
428
429int
414tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, int peek) 430tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, int peek)
415{ 431{
416 struct tls13_ctx *ctx = ssl->internal->tls13; 432 struct tls13_ctx *ctx = ssl->internal->tls13;