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.

classification
Title: _PyOS_URandom documentation
Type: Stage: resolved
Components: Documentation Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: christian.heimes, docs@python, loewis, pitrou, python-dev, vstinner
Priority: low Keywords: patch

Created on 2012-06-28 00:57 by christian.heimes, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
urandom_doc.patch vstinner, 2012-08-01 18:03 review
Messages (7)
msg164218 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2012-06-28 00:57
The comment for Python/random.c:_PyOS_URandom() states

> Fill buffer with size pseudo-random bytes, not suitable for cryptographic use, from the operating random number generator (RNG).

which is not correct as all paths use a RNG that is suitable for most cryptographic purposes except long living private keys for asymmetric encryption.

Also the function isn't documented although it's an official API function and plays a vital role on the new hash randomization.
msg164222 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-06-28 06:27
It's not an official API, as the leading underscore specifies. Changing the comment sounds fine to me.
msg167094 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-08-01 07:24
So can we close this issue, or should we start to document private functions?
msg167118 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-08-01 12:11
The comment needs to be fixed before the issue is closed.
msg167156 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-08-01 18:03
> The comment needs to be fixed before the issue is closed.

Ah yes, here is a patch updating the comment of _PyOS_URandom() and
the doc of the os module.
msg199097 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-06 16:47
New changeset 3e5078c3784e by Georg Brandl in branch '2.7':
Closes #15213: update comment for _PyOS_URandom
http://hg.python.org/cpython/rev/3e5078c3784e
msg199099 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-06 16:56
New changeset 176bb5a98463 by Georg Brandl in branch '3.3':
Closes #15213: update comment for _PyOS_URandom
http://hg.python.org/cpython/rev/176bb5a98463
History
Date User Action Args
2022-04-11 14:57:32adminsetgithub: 59418
2013-10-06 16:56:22python-devsetmessages: + msg199099
2013-10-06 16:47:51python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg199097

resolution: fixed
stage: resolved
2012-08-01 18:03:56vstinnersetfiles: + urandom_doc.patch
keywords: + patch
messages: + msg167156
2012-08-01 12:11:30pitrousetmessages: + msg167118
2012-08-01 07:24:24vstinnersetmessages: + msg167094
2012-06-28 06:27:41loewissetnosy: + loewis
messages: + msg164222
2012-06-28 00:57:03christian.heimescreate