Skip to content

Commit ce4939f

Browse files
committed
Use RAND_poll() for seeding randomness after fork().
OpenSSL deprecated RAND_cleanup(), and OpenSSL 1.1.0 made it into a no-op. Replace it with RAND_poll(), per an OpenSSL community recommendation. While this has no user-visible consequences under OpenSSL defaults, it might help under non-default settings. Daniel Gustafsson, reviewed by David Steele and Michael Paquier. Discussion: https://postgr.es/m/9B038FA5-23E8-40D0-B932-D515E1D8F66A@yesql.se
1 parent 0a0727c commit ce4939f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/postmaster/fork_process.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,12 @@ fork_process(void)
109109
}
110110

111111
/*
112-
* Make sure processes do not share OpenSSL randomness state.
112+
* Make sure processes do not share OpenSSL randomness state. This is
113+
* no longer required in OpenSSL 1.1.1 and later versions, but until
114+
* we drop support for version < 1.1.1 we need to do this.
113115
*/
114116
#ifdef USE_OPENSSL
115-
RAND_cleanup();
117+
RAND_poll();
116118
#endif
117119
}
118120

0 commit comments

Comments
 (0)