mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
9d01717f37
commit
fcfed19913
7 changed files with 65 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue