diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-06 12:54:58 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-06 12:54:58 (GMT) |
commit | fcfed1991382f9697df574fae4115a9f815adca0 (patch) | |
tree | 5f9519dcdc56aab61eea2e7d6ef280f1f70e47f5 /Modules/_ssl.c | |
parent | 9d01717f373d0180e2804c827efbc40d8cf72063 (diff) | |
download | cpython-fcfed1991382f9697df574fae4115a9f815adca0.zip cpython-fcfed1991382f9697df574fae4115a9f815adca0.tar.gz cpython-fcfed1991382f9697df574fae4115a9f815adca0.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/_ssl.c')
-rw-r--r-- | Modules/_ssl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 17beaf8..914d5aa 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -3335,6 +3335,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) { @@ -3362,6 +3363,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 */ @@ -3757,8 +3759,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 |