[openssl/openssl] d3072f: Limit the size of various MAXCHUNK definitions

Pauli noreply at github.com
Fri Aug 19 07:31:58 UTC 2022


  Branch: refs/heads/openssl-3.0
  Home:   https://github.com/openssl/openssl
  Commit: d3072f3f3ba3a6385bd41473483c9ee81443b684
      https://github.com/openssl/openssl/commit/d3072f3f3ba3a6385bd41473483c9ee81443b684
  Author: Pauli <pauli at openssl.org>
  Date:   2022-08-19 (Fri, 19 Aug 2022)

  Changed paths:
    M include/crypto/evp.h
    M providers/implementations/include/prov/ciphercommon.h

  Log Message:
  -----------
  Limit the size of various MAXCHUNK definitions

The current code has issues when sizeof(long) <> sizeof(size_t).  The two
types are assumed to be interchangeable and them being different will
cause crashes and endless loops.

This fix limits the maximum chunk size for many of the symmetric ciphers
to 2^30 bytes.  This chunk size limits the amount of data that will
be encrypted/decrypted in one lump.  The code internally handles block
of data later than the chunk limit, so this will present no difference
to the caller.  Any loss of efficiency due to limiting the chunking to
1Gbyte rather than more should be insignificant.

Fixes Coverity issues:
    1508498, 1508500 - 1508505, 1508507 - 1508527, 1508529 - 1508533,
    1508535 - 1508537, 1508539, 1508541 - 1508549, 1508551 - 1508569 &
    1508571 - 1508582.

Reviewed-by: Dmitry Belyavskiy <beldmit at gmail.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18997)

(cherry picked from commit 709d4be78f64a8ba0707fb5682b90039e848dad4)




More information about the openssl-commits mailing list