Use safe math to computer sizes.
authorPauli <pauli@openssl.org>
Tue, 15 Mar 2022 03:28:07 +0000 (14:28 +1100)
committerPauli <pauli@openssl.org>
Tue, 29 Mar 2022 23:10:25 +0000 (10:10 +1100)
commit330ff7e67d2ecc1c298fe7c4347c2109b4a979de
tree3aa2bf60d150b000cf64ff82e624b78dfc12e96a
parent4157a32867e6643da8daee94e836aaa18b9feed6
Use safe math to computer sizes.

The sizes are rounded via the expression: (cmpl + 7) / 8 which overflows if
cmpl is near to the type's maximum.  Instead we use the safe_math function to
computer this without any possibility of error.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17884)
crypto/evp/evp_enc.c