Open
Description
Description
OpenSSL documents the return value of RAND_load_file()
as
RETURN VALUES
RAND_load_file() returns the number of bytes read or -1 on error.
(from code inspection this happens to be correct).
The error check in php_openssl_load_rand_file()
will however interpret an error as success. People relying on seeding the PRNG might therefore proceed without having added any entropy to the pool. These days the RAND(7) of OpenSSL is claimed to be robust enough without explicit seeding, so there should be no security impact to this, but it would probably still be good to fix it since it goes against expectations:
php-src/ext/openssl/openssl_backend_common.c
Lines 443 to 452 in 4a98b36
PHP Version
PHP 8.4
Operating System
No response