From cb8525f4e5e097673125518e5a5f9e46ff5df2c9 Mon Sep 17 00:00:00 2001 From: jsing Date: Sun, 24 Jul 2022 14:31:37 +0000 Subject: [PATCH] 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@ --- lib/libssl/tls13_quic.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 * @@ -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; } -- 2.20.1