summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2022-07-24 14:31:38 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2022-07-24 14:31:38 +0000
commit579229c3d1916355c70f2e7c7c58302663d8d714 (patch)
tree32ce9669f6687583b929ee22f80ad8bd15f56325 /lib
parent48a0f815e39246b50b0057a57a37f50a00ef1aed (diff)
Set NULL BIOs for QUIC.
When used with QUIC, the SSL BIOs are effectively unused, however we still currently expect them to exist for status (such as SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE). Set up NULL BIOs if QUIC is in use. ok tb@
Diffstat (limited to 'lib')
-rw-r--r--lib/libssl/tls13_quic.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libssl/tls13_quic.c b/lib/libssl/tls13_quic.c
index 3f814188a74..52e09f03eb9 100644
--- a/lib/libssl/tls13_quic.c
+++ b/lib/libssl/tls13_quic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_quic.c,v 1.1 2022/07/24 14:28:16 jsing Exp $ */
+/* $OpenBSD: tls13_quic.c,v 1.2 2022/07/24 14:31:37 jsing Exp $ */
/*
* Copyright (c) 2022 Joel Sing <jsing@openbsd.org>
*
@@ -127,9 +127,22 @@ static const struct tls13_record_layer_callbacks quic_rl_callbacks = {
int
tls13_quic_init(struct tls13_ctx *ctx)
{
+ BIO *bio;
+
tls13_record_layer_set_callbacks(ctx->rl, &quic_rl_callbacks, ctx);
ctx->middlebox_compat = 0;
+ /*
+ * QUIC does not use BIOs, however we currently expect a BIO to exist
+ * for status handling.
+ */
+ if ((bio = BIO_new(BIO_s_null())) == NULL)
+ return 0;
+
+ BIO_up_ref(bio);
+ SSL_set_bio(ctx->ssl, bio, bio);
+ bio = NULL;
+
return 1;
}