openssl/util
Matt Caswell 65e2d67254 Simplify and rename SSL_set_rbio() and SSL_set_wbio()
SSL_set_rbio() and SSL_set_wbio() are new functions in 1.1.0 and really
should be called SSL_set0_rbio() and SSL_set0_wbio(). The old
implementation was not consistent with what "set0" means though as there
were special cases around what happens if the rbio and wbio are the same.
We were only ever taking one reference on the BIO, and checking everywhere
whether the rbio and wbio are the same so as not to double free.

A better approach is to rename the functions to SSL_set0_rbio() and
SSL_set0_wbio(). If an existing BIO is present it is *always* freed
regardless of whether the rbio and wbio are the same or not. It is
therefore the callers responsibility to ensure that a reference is taken
for *each* usage, i.e. one for the rbio and one for the wbio.

The legacy function SSL_set_bio() takes both the rbio and wbio in one go
and sets them both. We can wrap up the old behaviour in the implementation
of that function, i.e. previously if the rbio and wbio are the same in the
call to this function then the caller only needed to ensure one reference
was passed. This behaviour is retained by internally upping the ref count.

This commit was inspired by BoringSSL commit f715c423224.

RT#4572

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-07-29 14:09:57 +01:00
..
perl/OpenSSL/Util perl: refactor .pod name section extractor into its own module 2016-06-02 15:38:16 +02:00
TLSProxy Add a test for fragmented alerts 2016-06-27 14:51:03 +01:00
ck_errf.pl Copyright consolidation: perl files 2016-04-20 09:45:40 -04:00
copy.pl Allow spaces in filenames when using perl's glob 2016-05-04 09:35:00 +02:00
dofile.pl Copyright consolidation: perl files 2016-04-20 09:45:40 -04:00
find-doc-nits.pl RT4593: Add space after comma (doc nits) 2016-07-19 09:29:53 -04:00
find-undoc-api.pl Add script to find undocumented API 2016-06-07 10:05:06 -04:00
find-unused-errs GH1278: Removed error code for alerts 2016-07-08 13:28:33 -04:00
fipslink.pl Copyright consolidation: perl files 2016-04-20 09:45:40 -04:00
incore Add OpenSSL copyright to .pl files 2016-05-21 08:23:39 -04:00
indent.pro Replace all #define's in pod pages. 2016-07-08 12:55:45 -04:00
libcrypto.num Discard BIO_set(BIO* bio) method 2016-07-25 13:48:32 -04:00
libssl.num Simplify and rename SSL_set_rbio() and SSL_set_wbio() 2016-07-29 14:09:57 +01:00
mkbuildinf.pl Copyright consolidation: perl files 2016-04-20 09:45:40 -04:00
mkcerts.sh Fix verify(1) to report failure when verification fails 2016-01-13 17:55:17 -05:00
mkdef.pl include/openssl: don't include <windows.h> in public headers. 2016-07-08 11:49:44 +02:00
mkdir-p.pl utils/mkdir-p: check if dir exists also after mkdir failed 2016-06-23 11:10:29 -04:00
mkerr.pl Check for errors allocating the error strings. 2016-07-20 19:20:53 +02:00
mkrc.pl Copyright consolidation: perl files 2016-04-20 09:45:40 -04:00
openssl-format-source Add final(?) set of copyrights. 2016-06-01 11:27:25 -04:00
opensslwrap.sh opensslwrap.sh to respect $OPENSSL_ENGINES. 2006-12-29 15:00:36 +00:00
point.sh Updates from 1.0.0-stable 2009-04-06 15:22:01 +00:00
process_docs.pl perl: refactor .pod name section extractor into its own module 2016-06-02 15:38:16 +02:00
selftest.pl Copyright consolidation: perl files 2016-04-20 09:45:40 -04:00
shlib_wrap.sh Touch the correct variables for the system; shlib_wrap.sh on Solaris 2016-03-09 12:18:34 +01:00
su-filter.pl Copyright consolidation: perl files 2016-04-20 09:45:40 -04:00
with_fallback.pm Copyright consolidation; .pm and Configure 2016-04-20 10:40:05 -04:00