Move OpenSSL random under USE_OPENSSL_RANDOM
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-08-25T13:52:14Z
Lists: pgsql-hackers
Attachments
- openssl_random_macros.patch (application/octet-stream) patch
The USE_OPENSSL_RANDOM macro is defined when OpenSSL is used as a randomness provider, but the implementation of strong randomness is guarded by USE_OPENSSL in most places. This is technically the same thing today, but it seems hygienic to use the appropriate macro in case we ever want to allow OS randomness together with OpenSSL or something similar (or just make git grep easier which is my itch to scratch with this). The attached moves all invocations under the correct guards. RAND_poll() in fork_process.c needs to happen for both OpenSSL and OpenSSL random, thus the check for both. cheers ./daniel
Commits
-
Remove ability to independently select random number generator
- 16f96c74d48e 14.0 landed
-
Add pg_strong_random_init function to initialize random number generator
- 5ee180a39470 14.0 landed