boringssl/ssl
David Benjamin 7934f08b26 Replace init_msg/init_num with a get_message hook.
Rather than init_msg/init_num, there is a get_message function which
either returns success or try again. This function does not advance the
current message (see the previous preparatory change). It only completes
the current one if necessary.

Being idempotent means it may be freely placed at the top of states
which otherwise have other asychronous operations. It also eases
converting the TLS 1.2 state machine. See
https://docs.google.com/a/google.com/document/d/11n7LHsT3GwE34LAJIe3EFs4165TI4UR_3CqiM9LJVpI/edit?usp=sharing
for details.

The read_message hook (later to be replaced by something which doesn't
depend on BIO) intentionally does not finish the handshake, only "makes
progress". A follow-up change will align both TLS and DTLS on consuming
one handshake record and always consuming the entire record (so init_buf
may contain trailing data). In a few places I've gone ahead and
accounted for that case because it was more natural to do so.

This change also removes a couple pointers of redundant state from every
socket.

Bug: 128
Change-Id: I89d8f3622d3b53147d69ee3ac34bb654ed044a71
Reviewed-on: https://boringssl-review.googlesource.com/18806
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-08-08 21:13:04 +00:00
..
test Fix a bug in and test the message callback. 2017-08-03 18:52:47 +00:00
bio_ssl.cc Switch a number of files to C++. 2017-07-12 20:54:02 +00:00
CMakeLists.txt Add bssl::SealRecord and bssl::OpenRecord. 2017-07-24 20:14:08 +00:00
custom_extensions.cc Switch BORINGSSL_INTERNAL_CXX_TYPES in favor of subclassing games. 2017-07-20 17:24:12 +00:00
d1_both.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
d1_lib.cc Remove expect and received flight hooks. 2017-08-07 02:10:03 +00:00
d1_pkt.cc Remove expect and received flight hooks. 2017-08-07 02:10:03 +00:00
d1_srtp.cc Switch BORINGSSL_INTERNAL_CXX_TYPES in favor of subclassing games. 2017-07-20 17:24:12 +00:00
dtls_method.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
dtls_record.cc Switch BORINGSSL_INTERNAL_CXX_TYPES in favor of subclassing games. 2017-07-20 17:24:12 +00:00
handshake_client.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
handshake_server.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
internal.h Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
s3_both.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
s3_lib.cc Switch BORINGSSL_INTERNAL_CXX_TYPES in favor of subclassing games. 2017-07-20 17:24:12 +00:00
s3_pkt.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
span_test.cc Add bssl::SealRecord and bssl::OpenRecord. 2017-07-24 20:14:08 +00:00
ssl_aead_ctx.cc Make the bssl::SealRecord out_suffix arg fixed length. 2017-07-28 21:42:25 +00:00
ssl_asn1.cc Use new STACK_OF helpers. 2017-07-28 21:43:13 +00:00
ssl_buffer.cc Switch BORINGSSL_INTERNAL_CXX_TYPES in favor of subclassing games. 2017-07-20 17:24:12 +00:00
ssl_cert.cc Fix miscellaneous clang-tidy warnings. 2017-08-01 20:39:46 +00:00
ssl_cipher.cc Document the behaviour of non-standard separators in cipher strings. 2017-07-25 20:48:44 +00:00
ssl_file.cc Switch BORINGSSL_INTERNAL_CXX_TYPES in favor of subclassing games. 2017-07-20 17:24:12 +00:00
ssl_key_share.cc Convert SSL_ECDH_CTX to C++. 2017-07-20 21:27:23 +00:00
ssl_lib.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
ssl_privkey.cc More scopers. 2017-08-03 19:35:09 +00:00
ssl_session.cc Fix miscellaneous clang-tidy warnings. 2017-08-01 20:39:46 +00:00
ssl_stat.cc Replace reuse_message with an explicit next_message call. 2017-08-08 21:08:59 +00:00
ssl_test.cc Make the bssl::SealRecord out_suffix arg fixed length. 2017-07-28 21:42:25 +00:00
ssl_transcript.cc Convert SSL_TRANSCRIPT to C++. 2017-07-20 21:10:02 +00:00
ssl_versions.cc Switch BORINGSSL_INTERNAL_CXX_TYPES in favor of subclassing games. 2017-07-20 17:24:12 +00:00
ssl_x509.cc More scopers. 2017-08-03 19:35:09 +00:00
t1_enc.cc Convert SSL_TRANSCRIPT to C++. 2017-07-20 21:10:02 +00:00
t1_lib.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
tls13_both.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
tls13_client.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
tls13_enc.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
tls13_server.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
tls_method.cc Replace init_msg/init_num with a get_message hook. 2017-08-08 21:13:04 +00:00
tls_record.cc Fix a bug in bssl::OpenRecord. 2017-08-04 21:36:13 +00:00