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

Matt Caswell noreply at github.com
Mon Nov 14 11:36:05 UTC 2022


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

  Changed paths:
    M ssl/record/rec_layer_s3.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>
Reviewed-by: Paul Dale <pauli at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19264)

(cherry picked from commit 3d004cefec5135a3b080dc898d7f7d5452ef309f)




More information about the openssl-commits mailing list