boringssl/ssl
David Benjamin dc3da93899 Process alerts between ChangeCipherSpec and Finished.
This mostly[*] doesn't matter for TLS since the message would have been
rejected anyway, but, in DTLS, if the peer rejects our Finished, it will send
an encrypted alert. This will then cause it to hang, which isn't very helpful.

I've made the change on both TLS and DTLS so the two protocols don't diverge on
this point. It is true that we're accepting nominally encrypted and
authenticated alerts before Finished, but, prior to ChangeCipherSpec, the
alerts are sent in the clear anyway so an attacker could already inject alerts.
A consumer could only be sensitive to it being post-CCS if it was watching
msg_callback. The only non-debug consumer of msg_callback I've found anywhere
is some hostapd code to detect Heartbeat.

See https://code.google.com/p/webrtc/issues/detail?id=4403 for an instance
where the equivalent behavior in OpenSSL masks an alert.

[*] This does change behavior slightly if the peer sends a warning alert
between CCS and Finished. I believe this is benign as warning alerts are
usually ignored apart from info_callback and msg_callback. The one exception is
a close_notify which is a slightly new state (accepting close_notify during a
handshake seems questionable...), but they're processed pre-CCS too.

Change-Id: Idd0d49b9f9aa9d35374a9f5e2f815cdb931f5254
Reviewed-on: https://boringssl-review.googlesource.com/3883
Reviewed-by: Adam Langley <agl@google.com>
2015-03-13 20:19:11 +00:00
..
pqueue Fix memory leak in pqueue_test. 2015-02-11 23:18:45 +00:00
test Process alerts between ChangeCipherSpec and Finished. 2015-03-13 20:19:11 +00:00
CMakeLists.txt Precompute sorted array for error strings. 2015-02-09 17:35:31 -08:00
d1_both.c Fix Windows build. 2015-03-10 05:28:56 +00:00
d1_clnt.c Switch SSL_GET_MESSAGE_HASH_MESSAGE to an enum. 2015-03-05 21:26:28 +00:00
d1_lib.c Move handshake method hooks to SSL_PROTOCOL_METHOD. 2015-03-10 01:16:38 +00:00
d1_meth.c Remove ssl_version hook. 2015-03-10 01:16:54 +00:00
d1_pkt.c Process alerts between ChangeCipherSpec and Finished. 2015-03-13 20:19:11 +00:00
d1_srtp.c Store SRTP_PROTECTION_PROFILES as const. 2015-01-14 22:10:08 +00:00
d1_srvr.c Remove BIO_should_retry checks in DTLS state machines. 2015-02-23 19:32:27 +00:00
s3_both.c Switch SSL_GET_MESSAGE_HASH_MESSAGE to an enum. 2015-03-05 21:26:28 +00:00
s3_clnt.c Use EC_KEY_new_by_curve_name. 2015-03-13 19:49:39 +00:00
s3_enc.c Handle failures in ssl3_finish_mac. 2015-02-17 21:01:37 +00:00
s3_lib.c Move handshake method hooks to SSL_PROTOCOL_METHOD. 2015-03-10 01:16:38 +00:00
s3_meth.c Remove ssl_version hook. 2015-03-10 01:16:54 +00:00
s3_pkt.c Process alerts between ChangeCipherSpec and Finished. 2015-03-13 20:19:11 +00:00
s3_srvr.c Fix some missing return value checks in ssl3_send_new_session_ticket. 2015-03-13 19:17:01 +00:00
ssl_algs.c Precompute sorted array for error strings. 2015-02-09 17:35:31 -08:00
ssl_asn1.c Remove SSL_SESSION::cipher_id. 2015-01-14 21:10:55 +00:00
ssl_cert.c Add in missing curly braces part 3. 2015-02-11 15:14:46 -08:00
ssl_ciph.c Add SSL_CIPHER_get_rfc_name. 2015-02-09 17:31:28 -08:00
ssl_lib.c Error codes are uint32_t, not unsigned long. 2015-03-13 19:41:42 +00:00
ssl_locl.h Remove ssl_version hook. 2015-03-10 01:16:54 +00:00
ssl_rsa.c Don't EVP_PKEY_copy_parameters when configuring cert and key. 2015-02-17 21:03:29 +00:00
ssl_sess.c Minor formatting tweaks. 2015-03-13 19:17:23 +00:00
ssl_stat.c Remove server-side HelloVerifyRequest support. 2015-02-17 20:50:08 +00:00
ssl_test.c Use SSL_get_cipher_by_value in cipher_get_rfc_name tests. 2015-02-23 19:33:02 +00:00
ssl_txt.c Add in missing curly braces part 3. 2015-02-11 15:14:46 -08:00
t1_enc.c Don't delay-initialize legacy AEADs. 2015-03-05 21:25:05 +00:00
t1_lib.c Minor formatting tweaks. 2015-03-13 19:17:23 +00:00
t1_reneg.c Minor formatting tweaks. 2015-03-13 19:17:23 +00:00