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, Lukasa, alex, christian.heimes, doko, dstufft, larry, lemburg, martin.panter, matejcik, ned.deily, python-dev, rhettinger, skrah, thomas-petazzoni, vstinner, ztane
Date 2016-06-07.14:14:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465308899.07.0.639441134217.issue26839@psf.upfronthosting.co.za>
In-reply-to
Content
The attached patch (against tip) is a very quick attempt to implement the desired behavior:

* add a "nonblocking" argument to py_getrandom()
* dev_urandom_python() sets this to 0, to request blocking operation
* dev_urandom_noraise() sets this to 1 to request non-blocking

As far as I can tell, dev_urandom_noraise() is only called by _PyRandom_Init() so only the hash secret initialization will be affected.

Victor; can you take a look and let me know what you think? This probably needs some comments etc. before pushing. I'm also a little unsure about the rest of the logic in dev_urandom_noraise - it should probably also be modified to not block in the event that urandom is unavailable.
History
Date User Action Args
2016-06-07 14:14:59Colm Buckleysetrecipients: + Colm Buckley, lemburg, rhettinger, doko, vstinner, larry, christian.heimes, matejcik, ned.deily, alex, skrah, python-dev, martin.panter, ztane, dstufft, Lukasa, thomas-petazzoni
2016-06-07 14:14:59Colm Buckleysetmessageid: <1465308899.07.0.639441134217.issue26839@psf.upfronthosting.co.za>
2016-06-07 14:14:59Colm Buckleylinkissue26839 messages
2016-06-07 14:14:58Colm Buckleycreate