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.
Created on 2011年05月10日 08:10 by vstinner, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| ssl_rand_bytes.patch | vstinner, 2011年05月11日 20:52 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg135688 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2011年05月10日 08:10 | |
The _ssl module has RAND_add() RAND_status() and RAND_egd() functions, but not RAND_bytes(). I would be nice to be able to generate random bytes using RAND_bytes(). And maybe also RAND_pseudo_bytes()? I will work on a patch, it's just a reminder. |
|||
| msg135804 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2011年05月11日 20:52 | |
ssl_rand.patch adds RAND_bytes() and RAND_pseudo_bytes() functions to the ssl module. I moved /dev/urandom to /dev/urandom.xxx and /dev/random to /dev/random.xxx to test RAND_bytes() error path. In this case, RAND_pseudo_bytes() generates non-cryptographic pseudo-random bytes. RAND_pseudo_bytes() returns a tuple (bytes, is_cryptographic). In test_ssl, I used the assertion that RAND_pseudo_bytes() only generates cryptographic numbers if RAND_status() is 1. If the assertion is wrong, the test can be changed to just test the type of is_crytographic. RAND_bytes() and RAND_pseudo_bytes() raise a SSLError on error using ERR_get_errno() as the error code, whereas other ssl functions uses a value of the py_ssl_error enum. I don't know if it is the good choise. |
|||
| msg136728 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年05月24日 10:05 | |
New changeset 5c716437a83a by Victor Stinner in branch 'default': Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl http://hg.python.org/cpython/rev/5c716437a83a |
|||
| msg136785 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年05月24日 19:32 | |
New changeset ca92fa2fe5c9 by Victor Stinner in branch 'default': Issue #12049: improve RAND_bytes() and RAND_pseudo_bytes() documentation http://hg.python.org/cpython/rev/ca92fa2fe5c9 |
|||
| msg136832 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年05月25日 09:15 | |
New changeset 96a82c973224 by Victor Stinner in branch 'default': Issue #12049: test_ssl now checks also that RAND_bytes() raises an error if http://hg.python.org/cpython/rev/96a82c973224 |
|||
| msg136833 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年05月25日 09:27 | |
New changeset 178d367c9733 by Victor Stinner in branch 'default': Issue #12049: Document errors cases of ssl.RAND_bytes() and http://hg.python.org/cpython/rev/178d367c9733 |
|||
| msg136838 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年05月25日 11:14 | |
New changeset 195de3d10879 by Victor Stinner in branch 'default': Issue #12049: cleanup the warning in the random module doc http://hg.python.org/cpython/rev/195de3d10879 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:17 | admin | set | github: 56258 |
| 2011年05月25日 11:14:05 | python-dev | set | messages: + msg136838 |
| 2011年05月25日 09:27:43 | python-dev | set | messages: + msg136833 |
| 2011年05月25日 09:15:22 | python-dev | set | messages: + msg136832 |
| 2011年05月24日 19:32:50 | python-dev | set | messages: + msg136785 |
| 2011年05月24日 10:05:38 | vstinner | set | status: open -> closed resolution: fixed |
| 2011年05月24日 10:05:20 | python-dev | set | nosy:
+ python-dev messages: + msg136728 |
| 2011年05月11日 20:52:03 | vstinner | set | files:
+ ssl_rand_bytes.patch keywords: + patch messages: + msg135804 |
| 2011年05月10日 19:41:08 | jcon | set | nosy:
+ jcon |
| 2011年05月10日 08:10:02 | vstinner | create | |