boringssl/ssl
David Benjamin f715c42322 Make SSL_set_bio's ownership easier to reason about.
SSL_set_bio has some rather complex ownership story because whether rbio/wbio
are both owning depends on whether they are equal. Moreover, whether
SSL_set_bio(ssl, rbio, wbio) frees ssl->rbio depends on whether rbio is the
existing rbio or not. The current logic doesn't even get it right; see tests.

Simplify this. First, rbio and wbio are always owning. All the weird ownership
cases which we're stuck with for compatibility will live in SSL_set_bio. It
will internally BIO_up_ref if necessary and appropriately no-op the left or
right side as needed. It will then call more well-behaved ssl_set_rbio or
ssl_set_wbio functions as necessary.

Change-Id: I6b4b34e23ed01561a8c0aead8bb905363ee413bb
Reviewed-on: https://boringssl-review.googlesource.com/8240
Reviewed-by: Adam Langley <agl@google.com>
2016-06-14 19:40:25 +00:00
..
pqueue Don't cast |OPENSSL_malloc|/|OPENSSL_realloc| result. 2016-02-11 22:07:56 +00:00
test shim: fix var unused when asserts compiled out 2016-06-14 15:48:54 +00:00
CMakeLists.txt Rename s3_{clnt,srvr}.c 2016-06-08 19:25:31 +00:00
custom_extensions.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
d1_both.c Trim the DTLS write code slightly. 2016-06-08 19:33:20 +00:00
d1_lib.c Fold the DTLS client handshake into the TLS one. 2016-06-08 19:20:02 +00:00
d1_meth.c A bit of cleanup post state machine merging. 2016-06-08 19:24:32 +00:00
d1_pkt.c Trim the DTLS write code slightly. 2016-06-08 19:33:20 +00:00
d1_srtp.c Make kSRTPProfiles static. 2016-05-13 14:12:22 +00:00
dtls_record.c Fix the alias checks in dtls_record.c. 2016-06-09 21:11:22 +00:00
handshake_client.c Rename SERVER_DONE to SERVER_HELLO_DONE. 2016-06-08 19:26:59 +00:00
handshake_server.c Rename SERVER_DONE to SERVER_HELLO_DONE. 2016-06-08 19:26:59 +00:00
internal.h Wrap MSVC-only warning pragmas in a macro. 2016-06-09 21:29:36 +00:00
s3_both.c Fix ssl3_do_write error handling. 2016-06-09 23:51:08 +00:00
s3_enc.c Remove some easy obj.h dependencies. 2016-03-31 20:50:33 +00:00
s3_lib.c Move a bunch of public APIs from s3_lib.c to ssl_lib.c. 2016-06-08 19:27:44 +00:00
s3_meth.c A bit of cleanup post state machine merging. 2016-06-08 19:24:32 +00:00
s3_pkt.c Don't call read_bytes in read_change_cipher_spec. 2016-06-08 18:51:54 +00:00
ssl_aead_ctx.c Make tls_open_record always in-place. 2016-06-08 18:39:07 +00:00
ssl_asn1.c Check for overflow when parsing a CBS with d2i_*. 2015-11-16 23:17:42 +00:00
ssl_buffer.c Remove in-place TLS record assembly for now. 2016-06-09 19:47:44 +00:00
ssl_cert.c Ensure we check i2d_X509 return val 2016-04-26 17:12:01 +00:00
ssl_cipher.c Add SSL_CIPHER_is_DHE. 2016-06-03 17:57:05 +00:00
ssl_ecdh.c Generalizing curves to groups in preparation for TLS 1.3. 2016-05-20 17:43:11 +00:00
ssl_file.c Banish SSL_add_dir_cert_subjects_to_stack and OPENSSL_DIR_CTX to decrepit. 2016-04-27 18:40:25 +00:00
ssl_lib.c Make SSL_set_bio's ownership easier to reason about. 2016-06-14 19:40:25 +00:00
ssl_rsa.c Add |SSL_CTX_set_private_key_method| to parallel |SSL_set_private_key_method| 2016-03-07 18:16:58 +00:00
ssl_session.c Split unlock functions into read/write variants. 2016-05-31 21:09:29 +00:00
ssl_stat.c Remove state parameters to ssl3_get_message. 2016-05-18 20:51:48 +00:00
ssl_test.cc Make SSL_set_bio's ownership easier to reason about. 2016-06-14 19:40:25 +00:00
t1_enc.c Remove some easy obj.h dependencies. 2016-03-31 20:50:33 +00:00
t1_lib.c Generalizing curves to groups in preparation for TLS 1.3. 2016-05-20 17:43:11 +00:00
tls_record.c Remove in-place TLS record assembly for now. 2016-06-09 19:47:44 +00:00