summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2022-08-27 09:12:55 +0000
committerjsing <>2022-08-27 09:12:55 +0000
commitdfcfc35b3e4c9296d1b12a9a1a7f7a8dc44a91c2 (patch)
treefbe3ee91018c26f4d13820567a65a7ae3d6e6f51 /src
parent2b58d3e3f3e02023efcf3593785dc098eddb50fd (diff)
downloadopenbsd-dfcfc35b3e4c9296d1b12a9a1a7f7a8dc44a91c2.tar.gz
openbsd-dfcfc35b3e4c9296d1b12a9a1a7f7a8dc44a91c2.tar.bz2
openbsd-dfcfc35b3e4c9296d1b12a9a1a7f7a8dc44a91c2.zip
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 'src')
-rw-r--r--src/lib/libssl/tls13_quic.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_quic.c b/src/lib/libssl/tls13_quic.c
index ceb666ac4c..92bbb011c8 100644
--- a/src/lib/libssl/tls13_quic.c
+++ b/src/lib/libssl/tls13_quic.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_quic.c,v 1.4 2022/08/21 19:39:44 jsing Exp $ */ 1/* $OpenBSD: tls13_quic.c,v 1.5 2022/08/27 09:12:55 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2022 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -58,6 +58,9 @@ tls13_quic_handshake_read_cb(void *buf, size_t n, void *arg)
58{ 58{
59 struct tls13_ctx *ctx = arg; 59 struct tls13_ctx *ctx = arg;
60 60
61 if (ctx->hs->tls13.quic_read_buffer == NULL)
62 return TLS13_IO_WANT_POLLIN;
63
61 return tls_buffer_read(ctx->hs->tls13.quic_read_buffer, buf, n); 64 return tls_buffer_read(ctx->hs->tls13.quic_read_buffer, buf, n);
62} 65}
63 66