This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Colm Buckley
Recipients Colm Buckley, doko, lemburg, matejcik, rhettinger, skrah, socketpair, thomas-petazzoni, vstinner
Date 2016-05-13.19:35:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463168112.82.0.965616713352.issue26839@psf.upfronthosting.co.za>
In-reply-to
Content
See https://lwn.net/Articles/606141/ for an explanation of the blocking behavior of getrandom(). This makes sense to me - before the pool has initialized, /dev/urandom will be readable but will return highly predictable data - ie: it should not be considered safe. In other words, I think that getrandom() offers a sensible API.

The only circumstances where we hit the EAGAIN in getrandom() should be when it's called extremely early in the boot process (as is the case for the systemd-cron generator script I mentioned earlier). I think this is safe enough; a more thorough approach would be to flag that the per-process hash seed (_Py_HashSecret) is predictable and shouldn't be used.
History
Date User Action Args
2016-05-13 19:35:12Colm Buckleysetrecipients: + Colm Buckley, lemburg, rhettinger, doko, vstinner, matejcik, skrah, socketpair, thomas-petazzoni
2016-05-13 19:35:12Colm Buckleysetmessageid: <1463168112.82.0.965616713352.issue26839@psf.upfronthosting.co.za>
2016-05-13 19:35:12Colm Buckleylinkissue26839 messages
2016-05-13 19:35:12Colm Buckleycreate