win32-openssl.patch
text/x-diff
Filename: win32-openssl.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/port/pg_strong_random.c | 4 | 7 |
| src/tools/msvc/Solution.pm | 1 | 0 |
diff --git a/src/port/pg_strong_random.c b/src/port/pg_strong_random.c
index 6d85f50b7c..c5dfe4b072 100644
--- a/src/port/pg_strong_random.c
+++ b/src/port/pg_strong_random.c
@@ -24,7 +24,7 @@
#include <unistd.h>
#include <sys/time.h>
-#ifdef USE_OPENSSL_RANDOM
+#ifdef USE_OPENSSL
#include <openssl/rand.h>
#endif
#ifdef USE_WIN32_RANDOM
@@ -98,14 +98,11 @@ pg_strong_random_init(void)
#if defined(USE_OPENSSL_RANDOM)
/*
- * In case the backend is using the PRNG from OpenSSL without being built
- * with support for OpenSSL, make sure to perform post-fork initialization.
- * If the backend is using OpenSSL then we have already performed this
- * step. The same version caveat as discussed in the comment above applies
- * here as well.
+ * If attempting to use OpenSSL as random source without support for it,
+ * consider this combination as invalid.
*/
#ifndef USE_OPENSSL
- RAND_poll();
+#error cannot use OpenSSL as random source without building with it.
#endif
#elif defined(USE_WIN32_RANDOM)
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 17e480546c..cb01902ae9 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -525,6 +525,7 @@ sub GenerateFiles
if ($self->{options}->{openssl})
{
$define{USE_OPENSSL} = 1;
+ $define{USE_OPENSSL_RANDOM} = 1;
my ($digit1, $digit2, $digit3) = $self->GetOpenSSLVersion();