- Notifications
You must be signed in to change notification settings - Fork28
Commit1f919e6
committed
Guard against rare RAND_bytes() failures in pg_strong_random().
When built using OpenSSL, pg_strong_random() uses RAND_bytes() togenerate the random number. On very rare occasions that can fail, ifits PRNG has not been seeded with enough data. Additionally, once itdoes fail, all subsequent calls will also fail until more seed data isadded. Since this is required during backend startup, this can resultin all new backends failing to start until a postmaster restart.Guard against that by checking the state of OpenSSL's PRNG usingRAND_status(), and if necessary (very rarely), seeding it usingRAND_poll().Back-patch to v10, where pg_strong_random() was introduced.Dean Rasheed and Michael Paquier.Discussion:https://postgr.es/m/CAEZATCXMtxbzSAvyKKk5uCRf9pNt4UV%2BF_5v%3DgLfJUuPxU4Ytg%40mail.gmail.com1 parent6087932 commit1f919e6
1 file changed
+29
-0
lines changedLines changed: 29 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
103 | 103 |
| |
104 | 104 |
| |
105 | 105 |
| |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
106 | 135 |
| |
107 | 136 |
| |
108 | 137 |
| |
|
0 commit comments
Comments
(0)