diff options
author | 2014-04-16 03:21:29 +0000 | |
---|---|---|
committer | 2014-04-16 03:21:29 +0000 | |
commit | 03694647347aafbe3fec35392484d55bf2809176 (patch) | |
tree | 00d835b4a822baadb510e674cb7b2b04c81a322e | |
parent | missed vms comment (diff) | |
download | wireguard-openbsd-03694647347aafbe3fec35392484d55bf2809176.tar.xz wireguard-openbsd-03694647347aafbe3fec35392484d55bf2809176.zip |
API compat fix. RAND_load_file can never fail now. discovered and ok beck.
-rw-r--r-- | lib/libcrypto/rand/randfile.c | 10 | ||||
-rw-r--r-- | lib/libssl/src/crypto/rand/randfile.c | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/lib/libcrypto/rand/randfile.c b/lib/libcrypto/rand/randfile.c index 2cacebcf07a..9ba103369fa 100644 --- a/lib/libcrypto/rand/randfile.c +++ b/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/lib/libssl/src/crypto/rand/randfile.c b/lib/libssl/src/crypto/rand/randfile.c index 2cacebcf07a..9ba103369fa 100644 --- a/lib/libssl/src/crypto/rand/randfile.c +++ b/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) { |