diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-24 10:05:19 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-24 10:05:19 (GMT) |
| commit | 99c8b1614319ce0161835ade223cdd395f0126d4 (patch) | |
| tree | abe0d388da458164d5fe6fcfe6a3cac5619e531d /Lib/test/test_ssl.py | |
| parent | b7b1930fe374317c380e49add9fb4cc2267367e9 (diff) | |
| download | cpython-99c8b1614319ce0161835ade223cdd395f0126d4.zip cpython-99c8b1614319ce0161835ade223cdd395f0126d4.tar.gz cpython-99c8b1614319ce0161835ade223cdd395f0126d4.tar.bz2 | |
Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl
module.
Diffstat (limited to 'Lib/test/test_ssl.py')
| -rw-r--r-- | Lib/test/test_ssl.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index aef51e3..8c21975 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -102,6 +102,14 @@ class BasicSocketTests(unittest.TestCase): sys.stdout.write("\n RAND_status is %d (%s)\n" % (v, (v and "sufficient randomness") or "insufficient randomness")) + + data, is_cryptographic = ssl.RAND_pseudo_bytes(16) + self.assertEqual(len(data), 16) + self.assertEqual(is_cryptographic, v == 1) + if v: + data = ssl.RAND_bytes(16) + self.assertEqual(len(data), 16) + try: ssl.RAND_egd(1) except TypeError: |
