openssl/crypto/rand
Eugene Syromiatnikov 35db6a15d4 crypto/rand/randfile.c: avoid signed integer overflow in RAND_load_file
If a file supplied to RAND_load_file is too big (more than INT_MAX bytes),
it is possible to trigger a signer integer overflow during ret calculation.
Avoid it by returning early when we are about to hit it on the next
iteration.

Reported-by: Liu-Ermeng <liuermeng2@huawei.com>
Resolves: https://github.com/openssl/openssl/issues/28375
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28379)
2025-09-09 20:21:41 +02:00
..
build.info jitter: support an internal jitter entropy source in the FIPS provider 2024-10-09 13:53:10 +11:00
prov_seed.c rand: fix seeding from a weak entropy source 2023-10-24 11:14:11 +01:00
rand_deprecated.c Update copyright year 2022-05-03 13:34:51 +01:00
rand_egd.c Clarify use of EGD for HPNS in rand/rand_egd.c comments. 2022-06-17 09:28:19 +10:00
rand_err.c Add function to mix in an additional input into a RAND_POOL 2024-12-10 19:04:29 +01:00
rand_lib.c Fix failure checking on thread_local storage assignment in rand_lib 2025-08-09 09:22:13 -04:00
rand_local.h Elimination of some sources not needed in the FIPS_MODULE 2021-06-07 08:37:09 +02:00
rand_meth.c Elimination of some sources not needed in the FIPS_MODULE 2021-06-07 08:37:09 +02:00
rand_pool.c Add function to mix in an additional input into a RAND_POOL 2024-12-10 19:04:29 +01:00
rand_uniform.c internal/common.h: rename macro `(un)likely` to `ossl_(un)likely` 2023-11-03 21:08:22 +01:00
randfile.c crypto/rand/randfile.c: avoid signed integer overflow in RAND_load_file 2025-09-09 20:21:41 +02:00