diff options
Diffstat (limited to 'paramiko/transport.py')
-rw-r--r-- | paramiko/transport.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py index 1b5b72d0..e04db26a 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -303,7 +303,7 @@ class Transport (threading.Thread): # okay, normal socket-ish flow here... threading.Thread.__init__(self) self.setDaemon(True) - self.randpool = randpool + self.rng = rng self.sock = sock # Python < 2.3 doesn't have the settimeout method - RogerB try: @@ -591,7 +591,7 @@ class Transport (threading.Thread): @note: This has no effect when used in client mode. """ - Transport._modulus_pack = ModulusPack(randpool) + Transport._modulus_pack = ModulusPack(rng) # places to look for the openssh "moduli" file file_list = [ '/etc/ssh/moduli', '/usr/local/etc/moduli' ] if filename is not None: @@ -843,10 +843,9 @@ class Transport (threading.Thread): """ m = Message() m.add_byte(chr(MSG_IGNORE)) - randpool.stir() if bytes is None: - bytes = (ord(randpool.get_bytes(1)) % 32) + 10 - m.add_bytes(randpool.get_bytes(bytes)) + bytes = (ord(rng.read(1)) % 32) + 10 + m.add_bytes(rng.read(bytes)) self._send_user_message(m) def renegotiate_keys(self): @@ -1680,10 +1679,9 @@ class Transport (threading.Thread): else: available_server_keys = self._preferred_keys - randpool.stir() m = Message() m.add_byte(chr(MSG_KEXINIT)) - m.add_bytes(randpool.get_bytes(16)) + m.add_bytes(rng.read(16)) m.add_list(self._preferred_kex) m.add_list(available_server_keys) m.add_list(self._preferred_ciphers) |