boringssl/ssl
David Benjamin daf207a52a Don't use the buffer BIO in TLS.
On the TLS side, we introduce a running buffer of ciphertext. Queuing up
pending data consists of encrypting the record into the buffer. This
effectively reimplements what the buffer BIO was doing previously, but
this resizes to fit the whole flight.

As part of this, rename all the functions to add to the pending flight
to be more uniform. This CL proposes "add_foo" to add to the pending
flight and "flush_flight" to drain it.

We add an add_alert hook for alerts but, for now, only the SSL 3.0
warning alert (sent mid-handshake) uses this mechanism.  Later work will
push this down to the rest of the write path so closure alerts use it
too, as in DTLS. The intended end state is that all the ssl_buffer.c and
wpend_ret logic will only be used for application data and eventually
optionally replaced by the in-place API, while all "incidental" data
will be handled internally.

For now, the two buffers are mutually exclusive. Moving closure alerts
to "incidentals" will change this, but flushing application data early
is tricky due to wpend_ret. (If we call ssl_write_buffer_flush,
do_ssl3_write doesn't realize it still has a wpend_ret to replay.) That
too is all left alone in this change.

To keep the diff down, write_message is retained for now and will be
removed from the state machines in a follow-up change.

BUG=72

Change-Id: Ibce882f5f7196880648f25d5005322ca4055c71d
Reviewed-on: https://boringssl-review.googlesource.com/13224
Reviewed-by: Adam Langley <agl@google.com>
2017-01-25 23:35:47 +00:00
..
test Run go fmt on bogo code. 2017-01-24 00:29:38 +00:00
CMakeLists.txt Move a number of X.509 functions from ssl_lib.c to ssl_x509.c 2017-01-24 17:53:07 +00:00
custom_extensions.c Pass explicit hs parameters into custom_extensions.c. 2016-12-06 19:49:36 +00:00
d1_both.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
d1_lib.c Add a helper function for resetting SSL_get_error state. 2017-01-04 04:48:44 +00:00
d1_pkt.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
d1_srtp.c Fix ssl_ctx_make_profiles error handling. 2016-09-27 13:27:06 +00:00
dtls_method.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
dtls_record.c Don't use the buffer BIO in DTLS. 2017-01-25 23:35:32 +00:00
handshake_client.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
handshake_server.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
internal.h Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
s3_both.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
s3_enc.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
s3_lib.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
s3_pkt.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
ssl_aead_ctx.c Allow dtls_seal_record to work in-place. 2017-01-25 16:27:32 +00:00
ssl_asn1.c Enabling 0-RTT on new Session Tickets. 2017-01-06 16:24:43 +00:00
ssl_buffer.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
ssl_cert.c Remove unused |ssl_parse_x509|. 2017-01-24 17:51:04 +00:00
ssl_cipher.c Remove old ChaCha20-Poly1305 AEAD. 2017-01-19 23:27:54 +00:00
ssl_ecdh.c Remove New Hope key agreement. 2016-12-10 01:06:31 +00:00
ssl_file.c Check for sk_X509_NAME_push failures. 2016-09-27 13:18:37 +00:00
ssl_lib.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
ssl_rsa_cc.cc Convert one libssl function to C++11. 2017-01-17 21:51:06 +00:00
ssl_rsa.c Get OPENSSL_COMPILE_ASSERT working in function bodies. 2017-01-24 21:30:33 +00:00
ssl_session.c Enabling 0-RTT on new Session Tickets. 2017-01-06 16:24:43 +00:00
ssl_stat.c Move state and next_state to SSL_HANDSHAKE. 2016-12-12 22:09:01 +00:00
ssl_test.cc Fix ssl_test with BORINGSSL_ANDROID_SYSTEM. 2017-01-25 16:23:10 +00:00
ssl_x509.c Move a number of X.509 functions from ssl_lib.c to ssl_x509.c 2017-01-24 17:53:07 +00:00
t1_enc.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
t1_lib.c Get OPENSSL_COMPILE_ASSERT working in function bodies. 2017-01-24 21:30:33 +00:00
tls13_both.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
tls13_client.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
tls13_enc.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
tls13_server.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
tls_method.c Don't use the buffer BIO in TLS. 2017-01-25 23:35:47 +00:00
tls_record.c Don't use the buffer BIO in DTLS. 2017-01-25 23:35:32 +00:00