Tidy record length check. Compression is gone, so don't allow for compression overhead. With that fixed, the second rr->length check in ssl3_get_record matches the length computation which sizes the read buffer. The first is wrong and doesn't account for the alignment padding. Move the second to the first. Change-Id: I3f4f05de9fdf5c645ff24493bbfdf303dcc1aa90 Reviewed-on: https://boringssl-review.googlesource.com/4236 Reviewed-by: Adam Langley <agl@google.com>
diff --git a/include/openssl/ssl3.h b/include/openssl/ssl3.h index ab31a62..09705e1 100644 --- a/include/openssl/ssl3.h +++ b/include/openssl/ssl3.h
@@ -256,11 +256,11 @@ SSL3_RT_MAX_ENCRYPTED_OVERHEAD >= SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD, max_overheads_are_consistent); +/* SSL3_RT_MAX_COMPRESSED_LENGTH is an alias for + * |SSL3_RT_MAX_PLAIN_LENGTH|. Compression is gone, so don't include the + * compression overhead. */ +#define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH -/* If compression isn't used don't include the compression overhead */ - -#define SSL3_RT_MAX_COMPRESSED_LENGTH \ - (SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_COMPRESSED_OVERHEAD) #define SSL3_RT_MAX_ENCRYPTED_LENGTH \ (SSL3_RT_MAX_ENCRYPTED_OVERHEAD + SSL3_RT_MAX_COMPRESSED_LENGTH) #define SSL3_RT_MAX_PACKET_SIZE \