boringssl/ssl
David Benjamin 2f87112b96 Never expose ssl->bbio in the public API.
OpenSSL's bbio logic is kind of crazy. It would be good to eventually do the
buffering in a better way (notably, bbio is fragile, if not outright broken,
for DTLS). In the meantime, this fixes a number of bugs where the existence of
bbio was leaked in the public API and broke things.

- SSL_get_wbio returned the bbio during the handshake. It must always return
  the BIO the consumer configured. In doing so, internal accesses of
  SSL_get_wbio should be switched to ssl->wbio since those want to see bbio.
  For consistency, do the same with rbio.

- The logic in SSL_set_rfd, etc. (which I doubt is quite right since
  SSL_set_bio's lifetime is unclear) would get confused once wbio got wrapped.
  Those want to compare to SSL_get_wbio.

- If SSL_set_bio was called mid-handshake, bbio would get disconnected and lose
  state. It forgets to reattach the bbio afterwards. Unfortunately, Conscrypt
  does this a lot. It just never ended up calling it at a point where the bbio
  would cause problems.

- Make more explicit the invariant that any bbio's which exist are always
  attached. Simplify a few things as part of that.

Change-Id: Ia02d6bdfb9aeb1e3021a8f82dcbd0629f5c7fb8d
Reviewed-on: https://boringssl-review.googlesource.com/8023
Reviewed-by: Kenny Root <kroot@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2016-05-23 18:15:03 +00:00
..
pqueue Don't cast |OPENSSL_malloc|/|OPENSSL_realloc| result. 2016-02-11 22:07:56 +00:00
test Rename GetConfigPtr to GetTestConfig. 2016-05-23 15:34:02 +00:00
CMakeLists.txt Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
custom_extensions.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
d1_both.c Never expose ssl->bbio in the public API. 2016-05-23 18:15:03 +00:00
d1_clnt.c Add a TODO for why init_buf isn't released post-handshake. 2016-05-18 20:52:19 +00:00
d1_lib.c Never expose ssl->bbio in the public API. 2016-05-23 18:15:03 +00:00
d1_meth.c Pull ChangeCipherSpec into the handshake state machine. 2015-12-16 18:36:57 +00:00
d1_pkt.c Remove dead checks. 2016-05-18 20:52:38 +00:00
d1_srtp.c Make kSRTPProfiles static. 2016-05-13 14:12:22 +00:00
d1_srvr.c Add a TODO for why init_buf isn't released post-handshake. 2016-05-18 20:52:19 +00:00
dtls_record.c Move aead_{read,write}_ctx and next_proto_negotiated into ssl->s3. 2016-01-15 21:40:25 +00:00
internal.h Generalizing curves to groups in preparation for TLS 1.3. 2016-05-20 17:43:11 +00:00
s3_both.c Remove state parameters to ssl3_get_message. 2016-05-18 20:51:48 +00:00
s3_clnt.c Generalizing curves to groups in preparation for TLS 1.3. 2016-05-20 17:43:11 +00:00
s3_enc.c Remove some easy obj.h dependencies. 2016-03-31 20:50:33 +00:00
s3_lib.c Generalizing curves to groups in preparation for TLS 1.3. 2016-05-20 17:43:11 +00:00
s3_meth.c Pull ChangeCipherSpec into the handshake state machine. 2015-12-16 18:36:57 +00:00
s3_pkt.c Remove dead checks. 2016-05-18 20:52:38 +00:00
s3_srvr.c Generalizing curves to groups in preparation for TLS 1.3. 2016-05-20 17:43:11 +00:00
ssl_aead_ctx.c Disable all TLS crypto in fuzzer mode. 2016-03-02 23:39:36 +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 Set rwstate consistently. 2016-04-18 20:30:32 +00:00
ssl_cert.c Ensure we check i2d_X509 return val 2016-04-26 17:12:01 +00:00
ssl_cipher.c Client auth is only legal in certificate-based ciphers. 2016-05-13 20:07:16 +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 Never expose ssl->bbio in the public API. 2016-05-23 18:15:03 +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 Tidy up shutdown state. 2016-05-17 21:27:12 +00:00
ssl_stat.c Remove state parameters to ssl3_get_message. 2016-05-18 20:51:48 +00:00
ssl_test.cc BIO_new_mem_buf should take const void * 2016-02-24 19:14:19 +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 Disable all TLS crypto in fuzzer mode. 2016-03-02 23:39:36 +00:00