summaryrefslogtreecommitdiff
path: root/paramiko/common.py
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2008-01-21 11:42:16 -0800
committerRobey Pointer <robey@lag.net>2008-01-21 11:42:16 -0800
commit84eebc02f6088347ab1a76c3e53330538a0ab044 (patch)
treeb52edca1f678e7ccf2635277035eba3087e82833 /paramiko/common.py
parent38835bc24ca147b46470d063bce94670eaf901f8 (diff)
downloadparamiko-84eebc02f6088347ab1a76c3e53330538a0ab044.tar.gz
[project @ robey@lag.net-20080121194216-q3n5ovpeyiqjua6p]
patch from dwayne litzenberger to fix the PRNG to be more resilient when using windows, and some forking/threading environments.
Diffstat (limited to 'paramiko/common.py')
-rw-r--r--paramiko/common.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/paramiko/common.py b/paramiko/common.py
index 2dffad1b..89b34cf5 100644
--- a/paramiko/common.py
+++ b/paramiko/common.py
@@ -95,22 +95,10 @@ CONNECTION_FAILED_CODE = {
DISCONNECT_SERVICE_NOT_AVAILABLE, DISCONNECT_AUTH_CANCELLED_BY_USER, \
DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE = 7, 13, 14
-
-from Crypto.Util.randpool import PersistentRandomPool, RandomPool
+from osrandom import OSRandomPool
# keep a crypto-strong PRNG nearby
-import os
-try:
- randpool = PersistentRandomPool(os.path.join(os.path.expanduser('~'), '/.randpool'))
-except:
- # the above will likely fail on Windows - fall back to non-persistent random pool
- randpool = RandomPool()
-
-try:
- randpool.randomize()
-except:
- # earlier versions of pyCrypto (pre-2.0) don't have randomize()
- pass
+randpool = OSRandomPool()
import sys
if sys.version_info < (2, 3):