From 15831e18f08f80e932b98f6b5df01ef77e7b3155 Mon Sep 17 00:00:00 2001 From: tedu <> Date: Wed, 16 Apr 2014 03:21:29 +0000 Subject: API compat fix. RAND_load_file can never fail now. discovered and ok beck. --- src/lib/libcrypto/rand/randfile.c | 10 +++++++--- src/lib/libssl/src/crypto/rand/randfile.c | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c index 2cacebcf07..9ba103369f 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c @@ -80,9 +80,13 @@ * Entropy devices and EGD sockets are handled in rand_unix.c */ int RAND_load_file(const char *file, long bytes) - { - return(0); - } +{ + /* the "whole" file */ + if (bytes == -1) + return 123456; + else + return bytes; +} int RAND_write_file(const char *file) { diff --git a/src/lib/libssl/src/crypto/rand/randfile.c b/src/lib/libssl/src/crypto/rand/randfile.c index 2cacebcf07..9ba103369f 100644 --- a/src/lib/libssl/src/crypto/rand/randfile.c +++ b/src/lib/libssl/src/crypto/rand/randfile.c @@ -80,9 +80,13 @@ * Entropy devices and EGD sockets are handled in rand_unix.c */ int RAND_load_file(const char *file, long bytes) - { - return(0); - } +{ + /* the "whole" file */ + if (bytes == -1) + return 123456; + else + return bytes; +} int RAND_write_file(const char *file) { -- cgit v1.2.3-55-g6feb