diff options
author | Matt Caswell <matt@openssl.org> | 2020-05-08 11:12:10 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-05-15 11:26:43 +0100 |
commit | d30ef639647ad263d09740c931a5bfb5a8b6a5f6 (patch) | |
tree | c5219bd5e7abdce65a63850bc7d3657b4514795a /ssl/ssl_err.c | |
parent | 76899264cbff822929f29f3d56c640368461d7f6 (diff) |
Correct alignment calculation in ssl3_setup_write
The alignment calculation in ssl3_setup_write incorrectly results in an
alignment allowance of
(-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1) bytes. This equals 3
in almost all cases. The maximum alignment actually used in do_ssl3_write
is (SSL3_ALIGN_PAYLOAD - 1). This equals 7 bytes in almost all cases. So
there is a potential to overrun the buffer by up to 4 bytes.
Fortunately, the encryption overhead allowed for is 80 bytes which
consists of 16 bytes for the cipher block size and 64 bytes for the MAC
output. However the biggest MAC that we ever produce is HMAC-384 which is
48 bytes - so we have a headroom of 16 bytes (i.e. more than the 4 bytes
of potential overrun).
Thanks to Nagesh Hegde for reporting this.
Fixes #11766
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/11768)
Diffstat (limited to 'ssl/ssl_err.c')
0 files changed, 0 insertions, 0 deletions