diff -urN postgresql-7.1.3/src/interfaces/libpq/fe-connect.c postgresql-7.1.3-opensslfix/src/interfaces/libpq/fe-connect.c --- postgresql-7.1.3/src/interfaces/libpq/fe-connect.c Sat Mar 31 17:14:37 2001 +++ postgresql-7.1.3-opensslfix/src/interfaces/libpq/fe-connect.c Fri Jan 4 15:38:30 2002 @@ -19,6 +19,7 @@ #include #include #include +#include #include "libpq-fe.h" #include "libpq-int.h" @@ -984,6 +985,14 @@ { if (!SSL_context) { + char f_randfile[PATH_MAX]; + + /* Need to seed PRNG, too! */ + if (RAND_egd(RAND_file_name(f_randfile, sizeof(f_randfile))) < 0) { + /* Not an EGD, so read and write it. */ + if (RAND_load_file(f_randfile, -1)) + RAND_write_file(f_randfile); + } SSL_load_error_strings(); SSL_library_init(); SSL_context = SSL_CTX_new(SSLv23_method()); diff -urN postgresql-7.1.3/src/interfaces/libpq/libpq-fe.h postgresql-7.1.3-opensslfix/src/interfaces/libpq/libpq-fe.h --- postgresql-7.1.3/src/interfaces/libpq/libpq-fe.h Wed Mar 21 22:01:27 2001 +++ postgresql-7.1.3-opensslfix/src/interfaces/libpq/libpq-fe.h Thu Jan 3 14:08:18 2002 @@ -27,6 +27,7 @@ #include "postgres_ext.h" #ifdef USE_SSL #include +#include #endif /* Application-visible enum types */