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 JelleZijlstra
Recipients JelleZijlstra, Lukasa, brett.cannon, dstufft, ned.deily, steven.daprano, tim.peters
Date 2016-06-11.21:58:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465682320.94.0.717457726155.issue27288@psf.upfronthosting.co.za>
In-reply-to
Content
I'm interested in implementing this for 3.6, but I'm not sure exactly what the changes are that were decided upon. Is the following accurate?

1. Nothing changes in os (all the necessary changes were made in 3.5.2 already).
2. On Linux 3.17+ only, we add a new extension module called _secrets that provides a wrapper around the getrandom() system call and nothing else. I'll have to figure out whether to make the extension module just not exist all on non-Linux OSs (are there any existing extension modules that only exist on one OS?), or whether to make it empty on non-Linux. _secrets.getrandom() will look like def getrandom(buflen: int, flags: int) -> bytes.
3. We change secrets.SystemRandom so that on Linux 3.17+ only, it subclasses random.SystemRandom to use _secrets.getrandom() instead of os.urandom(). We will not pass in any flags to getrandom() (so we read from /dev/urandom and block until there is sufficient entropy). To make the subclassing easier, we may want to change random.SystemRandom to have a private method for calling os.urandom. (Currently, both of its methods call os.urandom directly.)
4. Similarly, we change secrets.token_bytes to use _secrets.getrandom(). Other functions in secrets.py won't need to change since they use secrets.SystemRandom or secrets.token_bytes.
5. _secrets and _secrets.getrandom will remain private and undocumented.
History
Date User Action Args
2016-06-11 21:58:40JelleZijlstrasetrecipients: + JelleZijlstra, tim.peters, brett.cannon, ned.deily, steven.daprano, dstufft, Lukasa
2016-06-11 21:58:40JelleZijlstrasetmessageid: <1465682320.94.0.717457726155.issue27288@psf.upfronthosting.co.za>
2016-06-11 21:58:40JelleZijlstralinkissue27288 messages
2016-06-11 21:58:40JelleZijlstracreate