Use LONG_MAX as the limit for ciphers with long based APIs.
authorjsing <jsing@openbsd.org>
Thu, 15 Sep 2022 07:04:19 +0000 (07:04 +0000)
committerjsing <jsing@openbsd.org>
Thu, 15 Sep 2022 07:04:19 +0000 (07:04 +0000)
commitfa590012edcba72d4393a768273b7d6de1543e6c
treeb296eca9f9473b11b47eaf61bd0ce511bc9a912a
parent644baa54bf2c5eb220d844de0afa4a826031af22
Use LONG_MAX as the limit for ciphers with long based APIs.

These ciphers have long based APIs, while EVP has a size_t based API. The
intent of these loops is to handle sizes that are bigger than LONG_MAX.
Rather than using the rather crazy EVP_MAXCHUNK construct, use LONG_MAX
rounded down to a large block size, ensuring that it is a block size
multiple. Revert the recently added overflow checks now that this is
handled more appropriately.

ok tb@
lib/libcrypto/evp/e_bf.c
lib/libcrypto/evp/e_cast.c
lib/libcrypto/evp/e_des.c
lib/libcrypto/evp/e_des3.c
lib/libcrypto/evp/e_idea.c
lib/libcrypto/evp/e_rc2.c