[openssl/openssl] ecacbc: Use the same encryption growth macro consistently

Matt Caswell noreply at github.com
Mon Nov 7 17:20:05 UTC 2022


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: ecacbc5e3c48901417e8e05bbf1d29df78610607
      https://github.com/openssl/openssl/commit/ecacbc5e3c48901417e8e05bbf1d29df78610607
  Author: Matt Caswell <matt at openssl.org>
  Date:   2022-11-07 (Mon, 07 Nov 2022)

  Changed paths:
    M ssl/record/methods/tls_common.c

  Log Message:
  -----------
  Use the same encryption growth macro consistently

We had two different macros for calculating the potential growth due to
encryption. The macro we use for allocating the underlying buffer should be
the same one that we use for reserving bytes for encryption growth.

Also if we are adding the MAC independently of the cipher algorithm then
the encryption growth will not include that MAC so we should remove it
from the amount of bytes that we reserve for that growth. Otherwise we
might exceed our buffer size and the WPACKET_reserve operation will
fail.

Reviewed-by: Hugo Landau <hlandau at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19622)




More information about the openssl-commits mailing list