Skip to content

Commit

Permalink
remove cleanup, go ahead and assume status will always be 1
Browse files Browse the repository at this point in the history
  • Loading branch information
reaperhulk committed Nov 20, 2017
1 parent 8ecce5a commit bee75ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
12 changes: 0 additions & 12 deletions src/OpenSSL/rand.py
Expand Up @@ -41,15 +41,3 @@ def status():
:return: 1 if the PRNG is seeded enough, 0 otherwise.
"""
return _lib.RAND_status()


def cleanup():
"""
Erase the memory used by the PRNG.
This is a wrapper for the C function ``RAND_cleanup``.
:return: :obj:`None`
"""
# TODO Nothing tests this call actually being made, or made properly.
_lib.RAND_cleanup()
12 changes: 1 addition & 11 deletions tests/test_rand.py
Expand Up @@ -35,14 +35,4 @@ def test_status(self):
`OpenSSL.rand.status` returns `1` if the PRNG has sufficient entropy,
`0` otherwise.
"""
# It's hard to know what it is actually going to return. Different
# OpenSSL random engines decide differently whether they have enough
# entropy or not.
assert rand.status() in (0, 1)

def test_cleanup(self):
"""
`OpenSSL.rand.cleanup` releases the memory used by the PRNG and
returns `None`.
"""
assert rand.cleanup() is None
assert rand.status() == 1

0 comments on commit bee75ee

Please sign in to comment.