[issue25003] os.urandom() should call getrandom(2) not getentropy(2) on Solaris 11.3 and newer
John Beck
report at bugs.python.org
Fri Sep 11 19:11:41 CEST 2015
John Beck added the comment:
Yes, those patches work, with a caveat. While testing this, I found out why I had needed EINVAL earlier (and still do, for now): there is a bug in the Solaris implementation of getrandom(2). If flags are 0 and the buffer size > 1024, then it fails with EINVAL. That is only supposed to happen for a buffer that big if GNRD_RANDOM is set in flags but GNRD_NONBLOCK is not set. So until that bug is fixed, I have to patch py_getrandom() to treat EINVAL like ENOSYS and fall back to using /dev/urandom as if getrandom(2) were not supported.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25003>
_______________________________________
More information about the Python-bugs-list
mailing list