diff options
author | Robey Pointer <robey@twitter.com> | 2011-05-21 19:29:38 -0700 |
---|---|---|
committer | Robey Pointer <robey@twitter.com> | 2011-05-21 19:29:38 -0700 |
commit | 5d9eeaedccd6321d182881b26961bbc8198e0aa9 (patch) | |
tree | 8089a12693ab590e710a6b98a14ad5144ef2bbb1 | |
parent | 22608540c3c5695637d9fa7e576a48e4af99c853 (diff) |
patch from sugarc0de to call Random.atfork() when starting up, so paramiko can be used in multiprocess code
-rw-r--r-- | paramiko/transport.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py index e04db26a..58a1b3e7 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -45,11 +45,7 @@ from paramiko.server import ServerInterface from paramiko.sftp_client import SFTPClient from paramiko.ssh_exception import SSHException, BadAuthenticationType, ChannelException -# these come from PyCrypt -# http://www.amk.ca/python/writing/pycrypt/ -# i believe this on the standards track. -# PyCrypt compiled for Win32 can be downloaded from the HashTar homepage: -# http://nitace.bsd.uchicago.edu:8080/hashtar +from Crypto import Random from Crypto.Cipher import Blowfish, AES, DES3, ARC4 from Crypto.Hash import SHA, MD5 try: @@ -456,6 +452,7 @@ class Transport (threading.Thread): # synchronous, wait for a result self.completion_event = event = threading.Event() self.start() + Random.atfork() while True: event.wait(0.1) if not self.active: |