API compat fix. RAND_load_file can never fail now. discovered and ok beck.
authortedu <tedu@openbsd.org>
Wed, 16 Apr 2014 03:21:29 +0000 (03:21 +0000)
committertedu <tedu@openbsd.org>
Wed, 16 Apr 2014 03:21:29 +0000 (03:21 +0000)
lib/libcrypto/rand/randfile.c
lib/libssl/src/crypto/rand/randfile.c

index 2cacebc..9ba1033 100644 (file)
  * 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)
        {
index 2cacebc..9ba1033 100644 (file)
  * 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)
        {