summaryrefslogtreecommitdiffstats
path: root/Doc/library/ssl.rst
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-24 10:05:19 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-24 10:05:19 (GMT)
commit99c8b1614319ce0161835ade223cdd395f0126d4 (patch)
treeabe0d388da458164d5fe6fcfe6a3cac5619e531d /Doc/library/ssl.rst
parentb7b1930fe374317c380e49add9fb4cc2267367e9 (diff)
downloadcpython-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 'Doc/library/ssl.rst')
-rw-r--r--Doc/library/ssl.rst20
1 files changed, 17 insertions, 3 deletions
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index 5ece8cf..a528a03 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -162,6 +162,20 @@ instead.
Random generation
^^^^^^^^^^^^^^^^^
+.. function:: RAND_bytes(num)
+
+ Returns *num* cryptographically strong pseudo-random bytes.
+
+ .. versionadded:: 3.3
+
+.. function:: RAND_pseudo_bytes(num)
+
+ Returns (bytes, is_cryptographic): bytes are *num* pseudo-random bytes,
+ is_cryptographic is True if the bytes generated are cryptographically
+ strong.
+
+ .. versionadded:: 3.3
+
.. function:: RAND_status()
Returns True if the SSL pseudo-random number generator has been seeded with
@@ -171,7 +185,7 @@ Random generation
.. function:: RAND_egd(path)
- If you are running an entropy-gathering daemon (EGD) somewhere, and ``path``
+ If you are running an entropy-gathering daemon (EGD) somewhere, and *path*
is the pathname of a socket connection open to it, this will read 256 bytes
of randomness from the socket, and add it to the SSL pseudo-random number
generator to increase the security of generated secret keys. This is
@@ -182,8 +196,8 @@ Random generation
.. function:: RAND_add(bytes, entropy)
- Mixes the given ``bytes`` into the SSL pseudo-random number generator. The
- parameter ``entropy`` (a float) is a lower bound on the entropy contained in
+ Mixes the given *bytes* into the SSL pseudo-random number generator. The
+ parameter *entropy* (a float) is a lower bound on the entropy contained in
string (so you can always use :const:`0.0`). See :rfc:`1750` for more
information on sources of entropy.