boringssl/ssl
David Benjamin f01f42a2ce Negotiate ciphers before resumption.
This changes our resumption strategy. Before, we would negotiate ciphers
only on fresh handshakes. On resumption, we would blindly use whatever
was in the session.

Instead, evaluate cipher suite preferences on every handshake.
Resumption requires that the saved cipher suite match the one that would
have been negotiated anyway. If client or server preferences changed
sufficiently, we decline the session.

This is much easier to reason about (we always pick the best cipher
suite), simpler, and avoids getting stuck under old preferences if
tickets are continuously renewed. Notably, although TLS 1.2 ticket
renewal does not work in practice, TLS 1.3 will renew tickets like
there's no tomorrow.

It also means we don't need dedicated code to avoid resuming a cipher
which has since been disabled. (That dedicated code was a little odd
anyway since the mask_k, etc., checks didn't occur. When cert_cb was
skipped on resumption, one could resume without ever configuring a
certificate! So we couldn't know whether to mask off RSA or ECDSA cipher
suites.)

Add tests which assert on this new arrangement.

BUG=116

Change-Id: Id40d851ccd87e06c46c6ec272527fd8ece8abfc6
Reviewed-on: https://boringssl-review.googlesource.com/11847
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-11-17 01:02:42 +00:00
..
test Negotiate ciphers before resumption. 2016-11-17 01:02:42 +00:00
CMakeLists.txt Add TLS 1.3 1-RTT. 2016-07-18 09:54:46 +00:00
custom_extensions.c Move extensions bitmasks into SSL_HANDSHAKE. 2016-10-09 16:48:52 +00:00
d1_both.c Replace hash_current_message with get_current_message. 2016-11-15 06:52:10 +00:00
d1_lib.c Remove RC4 from TLS for real. 2016-09-16 03:06:36 +00:00
d1_pkt.c Expose SSL_max_seal_overhead. 2016-11-09 16:51:46 +00:00
d1_srtp.c Fix ssl_ctx_make_profiles error handling. 2016-09-27 13:27:06 +00:00
dtls_method.c Replace hash_current_message with get_current_message. 2016-11-15 06:52:10 +00:00
dtls_record.c Take the version parameter out of ssl_do_msg_callback. 2016-09-21 18:55:27 +00:00
handshake_client.c Add tests for failing cert_cb. 2016-11-15 07:15:54 +00:00
handshake_server.c Negotiate ciphers before resumption. 2016-11-17 01:02:42 +00:00
internal.h Negotiate ciphers before resumption. 2016-11-17 01:02:42 +00:00
s3_both.c Parse ClientHello extensions before deciding on resumption. 2016-11-16 23:58:02 +00:00
s3_enc.c Move key_block into SSL_HANDSHAKE. 2016-11-09 17:02:33 +00:00
s3_lib.c Negotiate ciphers before resumption. 2016-11-17 01:02:42 +00:00
s3_pkt.c Expose SSL_max_seal_overhead. 2016-11-09 16:51:46 +00:00
ssl_aead_ctx.c Validate input iv/mac sizes in SSL_AEAD_CTX_new. 2016-10-28 21:25:35 +00:00
ssl_asn1.c Update to TLS 1.3 draft 18. 2016-11-15 06:57:21 +00:00
ssl_buffer.c Add SSL_is_dtls. 2016-08-02 20:43:58 +00:00
ssl_cert.c Update to TLS 1.3 draft 18. 2016-11-15 06:57:21 +00:00
ssl_cipher.c Trim ssl_create_cipher_list slightly. 2016-11-03 22:19:53 +00:00
ssl_ecdh.c Implement SSL_CTX_set1_curves_list() 2016-09-30 00:45:19 +00:00
ssl_file.c Check for sk_X509_NAME_push failures. 2016-09-27 13:18:37 +00:00
ssl_lib.c Parse ClientHello extensions before deciding on resumption. 2016-11-16 23:58:02 +00:00
ssl_rsa.c Rename X.509 members in |SSL_SESSION| and |CERT|. 2016-11-09 20:07:57 +00:00
ssl_session.c Negotiate ciphers before resumption. 2016-11-17 01:02:42 +00:00
ssl_stat.c Add the certificate_required alert. 2016-10-10 15:48:06 +00:00
ssl_test.cc Fix run_tests on fuzzer-mode builds. 2016-11-15 07:01:24 +00:00
t1_enc.c Move key_block into SSL_HANDSHAKE. 2016-11-09 17:02:33 +00:00
t1_lib.c Parse ClientHello extensions before deciding on resumption. 2016-11-16 23:58:02 +00:00
tls13_both.c Add a helper function for parsing extensions blocks. 2016-11-15 06:58:52 +00:00
tls13_client.c Tolerate cipher changes on TLS 1.3 resumption as a client. 2016-11-16 13:27:07 +00:00
tls13_enc.c Allow PSK binder mismatches in fuzzer mode. 2016-11-15 06:57:54 +00:00
tls13_server.c Negotiate ciphers before resumption. 2016-11-17 01:02:42 +00:00
tls_method.c Replace hash_current_message with get_current_message. 2016-11-15 06:52:10 +00:00
tls_record.c Enforce record-layer version numbers. 2016-11-13 05:28:35 +00:00