From c3ee9d5b386ed5ca575917396c75f5c4b61be679 Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Fri, 29 Aug 2025 10:29:26 +0200 Subject: [PATCH] doc/man3/RAND_load_file.pod: RAND_load_file on non-regular files with bytes=-1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Mention that RAND_load_file attempts to read only RAND_DRBG_STRENGTH bytes on non-regular files if the number of bytes to be read is not specified explicitly. Signed-off-by: Eugene Syromiatnikov Reviewed-by: Paul Dale Reviewed-by: Saša Nedvědický Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/28379) (cherry picked from commit 0daaf33275196dd5af9535d69b0d521b9e4d03de) --- doc/man3/RAND_load_file.pod | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/man3/RAND_load_file.pod b/doc/man3/RAND_load_file.pod index fd00bf883d4..9fad4d7175f 100644 --- a/doc/man3/RAND_load_file.pod +++ b/doc/man3/RAND_load_file.pod @@ -19,7 +19,9 @@ RAND_load_file, RAND_write_file, RAND_file_name - PRNG seed file RAND_load_file() reads a number of bytes from file B and adds them to the PRNG. If B is nonnegative, up to B are read; -if B is -1, the complete file is read. +if B is -1, the complete file is read (unless the file +is not a regular file, in that case a fixed number of bytes, +256 in the current implementation, is attempted to be read). RAND_load_file() can read less than the complete file or the requested number of bytes if it doesn't fit in the return value type. Do not load the same file multiple times unless its contents have -- 2.47.3