summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2022-08-27 09:12:56 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2022-08-27 09:12:56 +0000
commit19db48e8f8a7da9374285ec6bb2f5f37703b158a (patch)
tree39592b3777504fa676af33545ebf158789e0dabd /lib/libssl
parent09a6aa784539bcf4f04ea11df2e9dbb8d0552ab0 (diff)
Handle SSL_do_handshake() being called before SSL_provide_quic_data().
If SSL_do_handshake() is called before SSL_provide_quic_data() has been called, the QUIC read buffer will not have been initialised. In this case we want to return TLS13_IO_WANT_POLLIN so that the QUIC stack will provide handshake data.
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/tls13_quic.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libssl/tls13_quic.c b/lib/libssl/tls13_quic.c
index ceb666ac4c6..92bbb011c82 100644
--- a/lib/libssl/tls13_quic.c
+++ b/lib/libssl/tls13_quic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_quic.c,v 1.4 2022/08/21 19:39:44 jsing Exp $ */
+/* $OpenBSD: tls13_quic.c,v 1.5 2022/08/27 09:12:55 jsing Exp $ */
/*
* Copyright (c) 2022 Joel Sing <jsing@openbsd.org>
*
@@ -58,6 +58,9 @@ tls13_quic_handshake_read_cb(void *buf, size_t n, void *arg)
{
struct tls13_ctx *ctx = arg;
+ if (ctx->hs->tls13.quic_read_buffer == NULL)
+ return TLS13_IO_WANT_POLLIN;
+
return tls_buffer_read(ctx->hs->tls13.quic_read_buffer, buf, n);
}