diff options
Diffstat (limited to 'contrib/pgcrypto/openssl.c')
| -rw-r--r-- | contrib/pgcrypto/openssl.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c index cee2afe3e55..682683c210d 100644 --- a/contrib/pgcrypto/openssl.c +++ b/contrib/pgcrypto/openssl.c @@ -1062,10 +1062,6 @@ px_find_cipher(const char *name, PX_Cipher **res) static int openssl_random_init = 0; -#if OPENSSL_VERSION_NUMBER < 0x10100000L -#define RAND_OpenSSL RAND_SSLeay -#endif - /* * OpenSSL random should re-feeded occasionally. From /dev/urandom * preferably. @@ -1074,7 +1070,13 @@ static void init_openssl_rand(void) { if (RAND_get_rand_method() == NULL) + { +#ifdef HAVE_RAND_OPENSSL RAND_set_rand_method(RAND_OpenSSL()); +#else + RAND_set_rand_method(RAND_SSLeay()); +#endif + } openssl_random_init = 1; } |
