From: tb Date: Wed, 8 Sep 2021 12:32:07 +0000 (+0000) Subject: Prepare to provide SSL_set0_rbio() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0ebaf16933032198d1bc63fab41fc22394e814d2;p=openbsd Prepare to provide SSL_set0_rbio() This is needed for telephony/coturn and telephony/resiprocate to compile without opaque SSL. ok inoguchi jsing --- diff --git a/lib/libssl/ssl.h b/lib/libssl/ssl.h index 46f24b2ea9f..b8cfb771b6a 100644 --- a/lib/libssl/ssl.h +++ b/lib/libssl/ssl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.h,v 1.196 2021/06/30 18:07:50 jsing Exp $ */ +/* $OpenBSD: ssl.h,v 1.197 2021/09/08 12:32:07 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1256,6 +1256,9 @@ int SSL_set_rfd(SSL *s, int fd); int SSL_set_wfd(SSL *s, int fd); void SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio); BIO * SSL_get_rbio(const SSL *s); +#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) +void SSL_set0_rbio(SSL *s, BIO *rbio); +#endif BIO * SSL_get_wbio(const SSL *s); int SSL_set_cipher_list(SSL *s, const char *str); #if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c index 142771c423f..ef2a92ffe35 100644 --- a/lib/libssl/ssl_lib.c +++ b/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.264 2021/09/04 15:21:45 beck Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.265 2021/09/08 12:32:07 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -614,6 +614,13 @@ SSL_get_rbio(const SSL *s) return (s->rbio); } +void +SSL_set0_rbio(SSL *s, BIO *rbio) +{ + BIO_free_all(s->rbio); + s->rbio = rbio; +} + BIO * SSL_get_wbio(const SSL *s) {