diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-08-09 17:46:32 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-09-01 10:45:33 +0100 |
commit | 573f16c99719c9439a66a82fa256662d7cd32d47 (patch) | |
tree | 1915483492d55042e72639161684070ccd69860d /ssl | |
parent | 2e1760118b5ba316cdf0b144a21fb4c21f796c71 (diff) |
BIO_ssl: Make helper functions configure BIOs for QUIC correctly
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21715)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/bio_ssl.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c index ea72b394a1..b342c846da 100644 --- a/ssl/bio_ssl.c +++ b/ssl/bio_ssl.c @@ -438,6 +438,12 @@ BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx) #ifndef OPENSSL_NO_SOCK BIO *ret = NULL, *buf = NULL, *ssl = NULL; +# ifndef OPENSSL_NO_QUIC + if (ctx != NULL && IS_QUIC_CTX(ctx)) + /* Never use buffering for QUIC. */ + return BIO_new_ssl_connect(ctx); +# endif + if ((buf = BIO_new(BIO_f_buffer())) == NULL) return NULL; if ((ssl = BIO_new_ssl_connect(ctx)) == NULL) @@ -459,6 +465,13 @@ BIO *BIO_new_ssl_connect(SSL_CTX *ctx) if ((con = BIO_new(BIO_s_connect())) == NULL) return NULL; + +# ifndef OPENSSL_NO_QUIC + if (ctx != NULL && IS_QUIC_CTX(ctx)) + if (!BIO_set_sock_type(con, SOCK_DGRAM)) + goto err; +#endif + if ((ssl = BIO_new_ssl(ctx, 1)) == NULL) goto err; if ((ret = BIO_push(ssl, con)) == NULL) |