From 61672818efc108e16166491d0757f3baa1cfc9ec Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 14 Jul 2016 23:10:43 -0400 Subject: Check for buffered handshake messages on cipher change in DTLS. This is the equivalent of FragmentAcrossChangeCipherSuite for DTLS. It is possible for us to, while receiving pre-CCS handshake messages, to buffer up a message with sequence number meant for a post-CCS Finished. When we then get to the new epoch and attempt to read the Finished, we will process the buffered Finished although it was sent with the wrong encryption. Move ssl_set_{read,write}_state to SSL_PROTOCOL_METHOD hooks as this is a property of the transport. Notably, read_state may fail. In DTLS check the handshake buffer size. We could place this check in read_change_cipher_spec, but TLS 1.3 has no ChangeCipherSpec message, so we will need to implement this at the cipher change point anyway. (For now, there is only an assert on the TLS side. This will be replaced with a proper check in TLS 1.3.) Change-Id: Ia52b0b81e7db53e9ed2d4f6d334a1cce13e93297 Reviewed-on: https://boringssl-review.googlesource.com/8790 Reviewed-by: Steven Valdez Reviewed-by: David Benjamin Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- crypto/err/ssl.errordata | 1 + 1 file changed, 1 insertion(+) (limited to 'crypto') diff --git a/crypto/err/ssl.errordata b/crypto/err/ssl.errordata index f211a24f..f9d557e6 100644 --- a/crypto/err/ssl.errordata +++ b/crypto/err/ssl.errordata @@ -19,6 +19,7 @@ SSL,117,BAD_SSL_FILETYPE SSL,118,BAD_WRITE_RETRY SSL,119,BIO_NOT_SET SSL,120,BN_LIB +SSL,255,BUFFERED_MESSAGES_ON_CIPHER_CHANGE SSL,121,BUFFER_TOO_SMALL SSL,122,CA_DN_LENGTH_MISMATCH SSL,123,CA_DN_TOO_LONG -- cgit v1.2.3