-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
os.urandom() should use getentropy() of OpenBSD 5.6 #66775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The future OpenBSD 5.6 (scheduled in november 2014) will have a new getentropy() syscall and a new getentropy() in their C library which avoid the need of a file descriptor: Note: "The maximum buffer size permitted is 256 bytes. If buflen exceeds this, an error of EIO will be indicated." The file descriptor of os.urandom() causes perfomance issues and surprising bugs: bpo-18756, bpo-21207. For Python 2.7, see also the PEP-466 and the issue bpo-21305. See also issues: |
Here is a patch using getentropy() if available. I tested it on OpenBSD 5.6 (the only OS implementing this function...). The patch prepares also random.c to support Linux getrandom(): issue bpo-22181. |
New changeset 75ede5bec8db by Victor Stinner in branch 'default': |
New changeset f11f84902713 by Victor Stinner in branch '3.4': |
New changeset 371deb4a5fd1 by Ned Deily in branch '3.4': New changeset c89f7c34e356 by Ned Deily in branch 'default': New changeset 961efafe9497 by Ned Deily in branch '2.7': |
New changeset 9d3013a383eb by Victor Stinner in branch '3.4': New changeset 7f1015e4277a by Victor Stinner in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: