aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/pgp-mpi-internal.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2019-01-01 20:05:51 +0900
committerMichael Paquier <michael@paquier.xyz>2019-01-01 20:05:51 +0900
commit1707a0d2aa6b2bcfe78f63836c769943a1a6b9e0 (patch)
tree2e4acf6889358493cfda78582d54b8b751c3fbe5 /contrib/pgcrypto/pgp-mpi-internal.c
parentd880b208e5fcf55e3ae396d5fc5fa6639f58205f (diff)
downloadpostgresql-1707a0d2aa6b2bcfe78f63836c769943a1a6b9e0.tar.gz
postgresql-1707a0d2aa6b2bcfe78f63836c769943a1a6b9e0.zip
Remove configure switch --disable-strong-random
This removes a portion of infrastructure introduced by fe0a0b5 to allow compilation of Postgres in environments where no strong random source is available, meaning that there is no linking to OpenSSL and no /dev/urandom (Windows having its own CryptoAPI). No systems shipped this century lack /dev/urandom, and the buildfarm is actually not testing this switch at all, so just remove it. This simplifies particularly some backend code which included a fallback implementation using shared memory, and removes a set of alternate regression output files from pgcrypto. Author: Michael Paquier Reviewed-by: Tom Lane Discussion: https://postgr.es/m/20181230063219.GG608@paquier.xyz
Diffstat (limited to 'contrib/pgcrypto/pgp-mpi-internal.c')
-rw-r--r--contrib/pgcrypto/pgp-mpi-internal.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/contrib/pgcrypto/pgp-mpi-internal.c b/contrib/pgcrypto/pgp-mpi-internal.c
index 545009ce199..c73f086b0be 100644
--- a/contrib/pgcrypto/pgp-mpi-internal.c
+++ b/contrib/pgcrypto/pgp-mpi-internal.c
@@ -57,13 +57,12 @@ mp_clear_free(mpz_t *a)
static int
mp_px_rand(uint32 bits, mpz_t *res)
{
-#ifdef HAVE_STRONG_RANDOM
unsigned bytes = (bits + 7) / 8;
int last_bits = bits & 7;
uint8 *buf;
buf = px_alloc(bytes);
- if (!pg_strong_random((char *) buf, bytes))
+ if (!pg_strong_random(buf, bytes))
{
px_free(buf);
return PXE_NO_RANDOM;
@@ -83,9 +82,6 @@ mp_px_rand(uint32 bits, mpz_t *res)
px_free(buf);
return 0;
-#else
- return PXE_NO_RANDOM;
-#endif
}
static void