Message135804
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. |
|
Date |
User |
Action |
Args |
2011-05-11 20:53:04 | vstinner | set | recipients:
+ vstinner, pitrou, jcon |
2011-05-11 20:53:03 | vstinner | set | messageid: <1305147183.89.0.970992404469.issue12049@psf.upfronthosting.co.za> |
2011-05-11 20:52:03 | vstinner | link | issue12049 messages |
2011-05-11 20:52:03 | vstinner | create | |
|