STINNER Victor added the comment:

Martin Panter (msg267504): "As I understand it, if there is no entropy 
initialized, this patch will fall back to reading /dev/urandom, which will 
return predictable data (opposite of “random” data!)."

No, I don't think so.

Linux uses a lot of random sources, but some of them are seen as untrusted as 
so are added with a very low estimation of their entropy. Linux even adds some 
random values with a estimation of 0 bit of entropy. For example, drivers can 
add serial numbers as random numbers.

So even if getrandom() blocks, if the urandom entropy pool is not considered as 
fully initialized yet, I expect that /dev/urandom still generates *random* 
numbers, even if these numbers are not suitable to generate cryptographic keys.

Please double check, I'm not sure of what I wrote :-)

See also http://www.2uo.de/myths-about-urandom/ (but this article doesn't 
describe how urandom is initialized).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26839>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to