diff options
author | Michael Paquier | 2019-01-01 11:05:51 +0000 |
---|---|---|
committer | Michael Paquier | 2019-01-01 11:05:51 +0000 |
commit | 1707a0d2aa6b2bcfe78f63836c769943a1a6b9e0 (patch) | |
tree | 2e4acf6889358493cfda78582d54b8b751c3fbe5 /contrib/pgcrypto/pgp-pubenc.c | |
parent | d880b208e5fcf55e3ae396d5fc5fa6639f58205f (diff) |
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-pubenc.c')
-rw-r--r-- | contrib/pgcrypto/pgp-pubenc.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/contrib/pgcrypto/pgp-pubenc.c b/contrib/pgcrypto/pgp-pubenc.c index e4ff832f90d..08599f09786 100644 --- a/contrib/pgcrypto/pgp-pubenc.c +++ b/contrib/pgcrypto/pgp-pubenc.c @@ -39,7 +39,6 @@ static int pad_eme_pkcs1_v15(uint8 *data, int data_len, int res_len, uint8 **res_p) { -#ifdef HAVE_STRONG_RANDOM uint8 *buf, *p; int pad_len = res_len - 2 - data_len; @@ -50,7 +49,7 @@ pad_eme_pkcs1_v15(uint8 *data, int data_len, int res_len, uint8 **res_p) buf = px_alloc(res_len); buf[0] = 0x02; - if (!pg_strong_random((char *) buf + 1, pad_len)) + if (!pg_strong_random(buf + 1, pad_len)) { px_free(buf); return PXE_NO_RANDOM; @@ -62,7 +61,7 @@ pad_eme_pkcs1_v15(uint8 *data, int data_len, int res_len, uint8 **res_p) { if (*p == 0) { - if (!pg_strong_random((char *) p, 1)) + if (!pg_strong_random(p, 1)) { px_memset(buf, 0, res_len); px_free(buf); @@ -78,10 +77,6 @@ pad_eme_pkcs1_v15(uint8 *data, int data_len, int res_len, uint8 **res_p) *res_p = buf; return 0; - -#else - return PXE_NO_RANDOM; -#endif } static int |