diff --git a/electrum/__init__.py b/electrum/__init__.py index 793f2930c..e94ac78ac 100644 --- a/electrum/__init__.py +++ b/electrum/__init__.py @@ -46,3 +46,10 @@ except AssertionError: else: raise ImportError("Running with asserts disabled. Refusing to continue. Exiting...") + +# Check that os.urandom works +import zlib +length = len(zlib.compress(os.urandom(1000))) +if length <= 900: + raise ImportError("Broken PRNG. Refusing to continue. Exiting...") + diff --git a/electrum/rsakey.py b/electrum/rsakey.py index da87076fe..5266e9cf9 100644 --- a/electrum/rsakey.py +++ b/electrum/rsakey.py @@ -46,10 +46,6 @@ def SHA1(x): # PRNG Functions # ************************************************************************** -# Check that os.urandom works -import zlib -length = len(zlib.compress(os.urandom(1000))) -assert length > 900 def getRandomBytes(howMany): b = bytearray(os.urandom(howMany))