diff options
| author | jsing <> | 2022-07-24 14:31:37 +0000 |
|---|---|---|
| committer | jsing <> | 2022-07-24 14:31:37 +0000 |
| commit | 2d149b2866e29906b49da088ba99bba24275877c (patch) | |
| tree | 4eaf6718069b46bdec46dc5db8514d4926036f9d /src | |
| parent | f7f7655b1951f8dd9a8166cb6203a780f911d0bc (diff) | |
| download | openbsd-2d149b2866e29906b49da088ba99bba24275877c.tar.gz openbsd-2d149b2866e29906b49da088ba99bba24275877c.tar.bz2 openbsd-2d149b2866e29906b49da088ba99bba24275877c.zip | |
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 'src')
| -rw-r--r-- | src/lib/libssl/tls13_quic.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_quic.c b/src/lib/libssl/tls13_quic.c index 3f814188a7..52e09f03eb 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.1 2022/07/24 14:28:16 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_quic.c,v 1.2 2022/07/24 14:31:37 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -127,9 +127,22 @@ static const struct tls13_record_layer_callbacks quic_rl_callbacks = { | |||
| 127 | int | 127 | int |
| 128 | tls13_quic_init(struct tls13_ctx *ctx) | 128 | tls13_quic_init(struct tls13_ctx *ctx) |
| 129 | { | 129 | { |
| 130 | BIO *bio; | ||
| 131 | |||
| 130 | tls13_record_layer_set_callbacks(ctx->rl, &quic_rl_callbacks, ctx); | 132 | tls13_record_layer_set_callbacks(ctx->rl, &quic_rl_callbacks, ctx); |
| 131 | 133 | ||
| 132 | ctx->middlebox_compat = 0; | 134 | ctx->middlebox_compat = 0; |
| 133 | 135 | ||
| 136 | /* | ||
| 137 | * QUIC does not use BIOs, however we currently expect a BIO to exist | ||
| 138 | * for status handling. | ||
| 139 | */ | ||
| 140 | if ((bio = BIO_new(BIO_s_null())) == NULL) | ||
| 141 | return 0; | ||
| 142 | |||
| 143 | BIO_up_ref(bio); | ||
| 144 | SSL_set_bio(ctx->ssl, bio, bio); | ||
| 145 | bio = NULL; | ||
| 146 | |||
| 134 | return 1; | 147 | return 1; |
| 135 | } | 148 | } |
