From 909aa27d54541593d895a95cf88b5db90172321c Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 20 Nov 2017 21:41:46 +0800 Subject: [PATCH] remove cleanup, go ahead and assume status will always be 1 --- src/OpenSSL/rand.py | 12 ------------ tests/test_rand.py | 12 +----------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/OpenSSL/rand.py b/src/OpenSSL/rand.py index 969f5b1d8..72c678c97 100644 --- a/src/OpenSSL/rand.py +++ b/src/OpenSSL/rand.py @@ -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() diff --git a/tests/test_rand.py b/tests/test_rand.py index bd61f47e6..e04a24cc2 100644 --- a/tests/test_rand.py +++ b/tests/test_rand.py @@ -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