[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-76]

add a few more randpool.stir() calls
This commit is contained in:
Robey Pointer 2005-10-31 03:27:13 +00:00
parent 25d55e6089
commit b1d58c5ceb
3 changed files with 6 additions and 2 deletions

View File

@ -147,6 +147,7 @@ class DSSKey (PKey):
@since: fearow @since: fearow
""" """
randpool.stir()
dsa = DSA.generate(bits, randpool.get_bytes, progress_func) dsa = DSA.generate(bits, randpool.get_bytes, progress_func)
key = DSSKey(vals=(dsa.p, dsa.q, dsa.g, dsa.y)) key = DSSKey(vals=(dsa.p, dsa.q, dsa.g, dsa.y))
key.x = dsa.x key.x = dsa.x

View File

@ -123,6 +123,7 @@ class RSAKey (PKey):
@since: fearow @since: fearow
""" """
randpool.stir()
rsa = RSA.generate(bits, randpool.get_bytes, progress_func) rsa = RSA.generate(bits, randpool.get_bytes, progress_func)
key = RSAKey(vals=(rsa.e, rsa.n)) key = RSAKey(vals=(rsa.e, rsa.n))
key.d = rsa.d key.d = rsa.d

View File

@ -140,7 +140,7 @@ class Transport (threading.Thread):
""" """
_PROTO_ID = '2.0' _PROTO_ID = '2.0'
_CLIENT_ID = 'paramiko_1.5' _CLIENT_ID = 'paramiko_1.5.1'
_preferred_ciphers = ( 'aes128-cbc', 'blowfish-cbc', 'aes256-cbc', '3des-cbc' ) _preferred_ciphers = ( 'aes128-cbc', 'blowfish-cbc', 'aes256-cbc', '3des-cbc' )
_preferred_macs = ( 'hmac-sha1', 'hmac-md5', 'hmac-sha1-96', 'hmac-md5-96' ) _preferred_macs = ( 'hmac-sha1', 'hmac-md5', 'hmac-sha1-96', 'hmac-md5-96' )
@ -637,6 +637,7 @@ class Transport (threading.Thread):
""" """
m = Message() m = Message()
m.add_byte(chr(MSG_IGNORE)) m.add_byte(chr(MSG_IGNORE))
randpool.stir()
if bytes is None: if bytes is None:
bytes = (ord(randpool.get_bytes(1)) % 32) + 10 bytes = (ord(randpool.get_bytes(1)) % 32) + 10
m.add_bytes(randpool.get_bytes(bytes)) m.add_bytes(randpool.get_bytes(bytes))
@ -1399,6 +1400,7 @@ class Transport (threading.Thread):
else: else:
available_server_keys = self._preferred_keys available_server_keys = self._preferred_keys
randpool.stir()
m = Message() m = Message()
m.add_byte(chr(MSG_KEXINIT)) m.add_byte(chr(MSG_KEXINIT))
m.add_bytes(randpool.get_bytes(16)) m.add_bytes(randpool.get_bytes(16))