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

Created on 2012-06-28 00:57 by christian.heimes, last changed 2012-08-01 18:03 by haypo.

Files
File name Uploaded Description Edit
urandom_doc.patch haypo, 2012-08-01 18:03 review
Messages (5)
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 (haypo) * (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 (haypo) * (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.
History
Date User Action Args
2012-08-01 18:03:56hayposetfiles: + urandom_doc.patch
keywords: + patch
messages: + msg167156
2012-08-01 12:11:30pitrousetmessages: + msg167118
2012-08-01 07:24:24hayposetmessages: + msg167094
2012-06-28 06:27:41loewissetnosy: + loewis
messages: + msg164222
2012-06-28 00:57:03christian.heimescreate