postgresql/contrib/pgcrypto/expected
Heikki Linnakangas fe0a0b5993 Replace PostmasterRandom() with a stronger source, second attempt.
This adds a new routine, pg_strong_random() for generating random bytes,
for use in both frontend and backend. At the moment, it's only used in
the backend, but the upcoming SCRAM authentication patches need strong
random numbers in libpq as well.

pg_strong_random() is based on, and replaces, the existing implementation
in pgcrypto. It can acquire strong random numbers from a number of sources,
depending on what's available:

- OpenSSL RAND_bytes(), if built with OpenSSL
- On Windows, the native cryptographic functions are used
- /dev/urandom

Unlike the current pgcrypto function, the source is chosen by configure.
That makes it easier to test different implementations, and ensures that
we don't accidentally fall back to a less secure implementation, if the
primary source fails. All of those methods are quite reliable, it would be
pretty surprising for them to fail, so we'd rather find out by failing
hard.

If no strong random source is available, we fall back to using erand48(),
seeded from current timestamp, like PostmasterRandom() was. That isn't
cryptographically secure, but allows us to still work on platforms that
don't have any of the above stronger sources. Because it's not very secure,
the built-in implementation is only used if explicitly requested with
--disable-strong-random.

This replaces the more complicated Fortuna algorithm we used to have in
pgcrypto, which is unfortunate, but all modern platforms have /dev/urandom,
so it doesn't seem worth the maintenance effort to keep that. pgcrypto
functions that require strong random numbers will be disabled with
--disable-strong-random.

Original patch by Magnus Hagander, tons of further work by Michael Paquier
and me.

Discussion: https://www.postgresql.org/message-id/CAB7nPqRy3krN8quR9XujMVVHYtXJ0_60nqgVc6oUk8ygyVkZsA@mail.gmail.com
Discussion: https://www.postgresql.org/message-id/CAB7nPqRWkNYRRPJA7-cF+LfroYV10pvjdz6GNvxk-Eee9FypKA@mail.gmail.com
2016-12-05 13:42:59 +02:00
..
3des.out
blowfish.out
cast5.out
crypt-blowfish.out pgcrypto: Detect and report too-short crypt() salts. 2015-10-05 10:06:29 -04:00
crypt-des.out pgcrypto: Detect and report too-short crypt() salts. 2015-10-05 10:06:29 -04:00
crypt-md5.out
crypt-xdes.out pgcrypto: Detect and report too-short crypt() salts. 2015-10-05 10:06:29 -04:00
des.out
hmac-md5.out
hmac-sha1.out
init.out
md5.out
pgp-armor.out Add functions for dealing with PGP armor header lines to pgcrypto. 2014-10-01 16:03:39 +03:00
pgp-compression_1.out Replace PostmasterRandom() with a stronger source, second attempt. 2016-12-05 13:42:59 +02:00
pgp-compression.out
pgp-decrypt_1.out Replace PostmasterRandom() with a stronger source, second attempt. 2016-12-05 13:42:59 +02:00
pgp-decrypt.out pgcrypto: Report errant decryption as "Wrong key or corrupt data". 2015-05-18 10:02:31 -04:00
pgp-encrypt_1.out Replace PostmasterRandom() with a stronger source, second attempt. 2016-12-05 13:42:59 +02:00
pgp-encrypt.out pgcrypto: support changing S2K iteration count 2016-03-09 14:31:07 -03:00
pgp-info.out Fix buffer overrun after incomplete read in pullf_read_max(). 2015-02-02 10:00:45 -05:00
pgp-pubkey-decrypt.out pgcrypto: Report errant decryption as "Wrong key or corrupt data". 2015-05-18 10:02:31 -04:00
pgp-pubkey-encrypt_1.out Replace PostmasterRandom() with a stronger source, second attempt. 2016-12-05 13:42:59 +02:00
pgp-pubkey-encrypt.out
pgp-zlib-DISABLED.out
rijndael.out
sha1.out
sha2.out