summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-11-28 12:28:25 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-11-28 12:28:25 (GMT)
commitbeeb512fe1d8c502d854d7e27742a7481bccd5c4 (patch)
tree8e89fe1a29f57d4ea5f0e095110f257d77680a00 /Modules
parent07ff92a0d2c98f55bd863cdc5d6f62975f4994e5 (diff)
downloadcpython-beeb512fe1d8c502d854d7e27742a7481bccd5c4.zip
cpython-beeb512fe1d8c502d854d7e27742a7481bccd5c4.tar.gz
cpython-beeb512fe1d8c502d854d7e27742a7481bccd5c4.tar.bz2
Issue #21356: Make ssl.RAND_egd() optional to support LibreSSL. The
availability of the function is checked during the compilation. Patch written by Bernard Spil.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index de9a5b4..29e7469 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -3713,6 +3713,7 @@ Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.\n\
It is necessary to seed the PRNG with RAND_add() on some platforms before\n\
using the ssl() function.");
+#ifdef HAVE_RAND_EGD
static PyObject *
PySSL_RAND_egd(PyObject *self, PyObject *args)
{
@@ -3740,6 +3741,7 @@ PyDoc_STRVAR(PySSL_RAND_egd_doc,
Queries the entropy gather daemon (EGD) on the socket named by 'path'.\n\
Returns number of bytes read. Raises SSLError if connection to EGD\n\
fails or if it does not provide enough data to seed PRNG.");
+#endif /* HAVE_RAND_EGD */
#endif /* HAVE_OPENSSL_RAND */
@@ -4135,8 +4137,10 @@ static PyMethodDef PySSL_methods[] = {
PySSL_RAND_bytes_doc},
{"RAND_pseudo_bytes", PySSL_RAND_pseudo_bytes, METH_VARARGS,
PySSL_RAND_pseudo_bytes_doc},
+#ifdef HAVE_RAND_EGD
{"RAND_egd", PySSL_RAND_egd, METH_VARARGS,
PySSL_RAND_egd_doc},
+#endif
{"RAND_status", (PyCFunction)PySSL_RAND_status, METH_NOARGS,
PySSL_RAND_status_doc},
#endif