Skip to content

Commit 1f388b8

Browse files
committed
Remove EGD
EGD was only necessary for some commercial UNIX systems, versions that needed it all reached end of life. EGD needed until OS release date IRIX 6.5.19 feb 2003 Solaris 2.6 jul 1997 AIX 5.2 oct 2002 Tru64 5.1B sep 2002 HP-UX 11i v2 sep 2003 https://en.wikipedia.org/wiki//dev/random#EGD_as_an_alternative
1 parent 496f40d commit 1f388b8

File tree

3 files changed

+0
-67
lines changed

3 files changed

+0
-67
lines changed

OpenSSL/rand.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,6 @@ def status():
9393

9494

9595

96-
def egd(path, bytes=_unspecified):
97-
"""
98-
Query an entropy gathering daemon (EGD) for random data and add it to the
99-
PRNG. I haven't found any problems when the socket is missing, the function
100-
just returns 0.
101-
102-
:param path: The path to the EGD socket
103-
:param bytes: (optional) The number of bytes to read, default is 255
104-
:returns: The number of bytes read (NB: a value of 0 isn't necessarily an
105-
error, check rand.status())
106-
"""
107-
if not isinstance(path, _builtin_bytes):
108-
raise TypeError("path must be a byte string")
109-
110-
if bytes is _unspecified:
111-
bytes = 255
112-
elif not isinstance(bytes, int):
113-
raise TypeError("bytes must be an integer")
114-
115-
return _lib.RAND_egd_bytes(path, bytes)
116-
117-
118-
11996
def cleanup():
12097
"""
12198
Erase the memory used by the PRNG.

OpenSSL/test/test_rand.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -103,43 +103,6 @@ def test_status(self):
103103
self.assertTrue(rand.status() in (1, 2))
104104

105105

106-
def test_egd_wrong_args(self):
107-
"""
108-
:py:obj:`OpenSSL.rand.egd` raises :py:obj:`TypeError` when called with the wrong
109-
number of arguments or with arguments not of type :py:obj:`str` and :py:obj:`int`.
110-
"""
111-
self.assertRaises(TypeError, rand.egd)
112-
self.assertRaises(TypeError, rand.egd, None)
113-
self.assertRaises(TypeError, rand.egd, "foo", None)
114-
self.assertRaises(TypeError, rand.egd, None, 3)
115-
self.assertRaises(TypeError, rand.egd, "foo", 3, None)
116-
117-
118-
def test_egd_missing(self):
119-
"""
120-
:py:obj:`OpenSSL.rand.egd` returns :py:obj:`0` or :py:obj:`-1` if the
121-
EGD socket passed to it does not exist.
122-
"""
123-
result = rand.egd(self.mktemp())
124-
expected = (-1, 0)
125-
self.assertTrue(
126-
result in expected,
127-
"%r not in %r" % (result, expected))
128-
129-
130-
def test_egd_missing_and_bytes(self):
131-
"""
132-
:py:obj:`OpenSSL.rand.egd` returns :py:obj:`0` or :py:obj:`-1` if the
133-
EGD socket passed to it does not exist even if a size argument is
134-
explicitly passed.
135-
"""
136-
result = rand.egd(self.mktemp(), 1024)
137-
expected = (-1, 0)
138-
self.assertTrue(
139-
result in expected,
140-
"%r not in %r" % (result, expected))
141-
142-
143106
def test_cleanup_wrong_args(self):
144107
"""
145108
:py:obj:`OpenSSL.rand.cleanup` raises :py:obj:`TypeError` when called with any

doc/api/rand.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ declares the following:
3131
This is a wrapper for the C function :py:func:`RAND_cleanup`.
3232

3333

34-
.. py:function:: egd(path[, bytes])
35-
36-
Query the `Entropy Gathering Daemon <http://www.lothar.com/tech/crypto/>`_ on
37-
socket *path* for *bytes* bytes of random data and uses :py:func:`add` to
38-
seed the PRNG. The default value of *bytes* is 255.
39-
40-
4134
.. py:function:: load_file(path[, bytes])
4235
4336
Read *bytes* bytes (or all of it, if *bytes* is negative) of data from the

0 commit comments

Comments
 (0)