[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

@ -140,13 +140,14 @@ class DSSKey (PKey):
@param bits: number of bits the generated key should be.
@type bits: int
@param progress_func: an optional function to call at key points in
key generation (used by C{pyCrypto.PublicKey}).
key generation (used by C{pyCrypto.PublicKey}).
@type progress_func: function
@return: new private key
@rtype: L{DSSKey}
@since: fearow
"""
randpool.stir()
dsa = DSA.generate(bits, randpool.get_bytes, progress_func)
key = DSSKey(vals=(dsa.p, dsa.q, dsa.g, dsa.y))
key.x = dsa.x

View File

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

View File

@ -140,7 +140,7 @@ class Transport (threading.Thread):
"""
_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_macs = ( 'hmac-sha1', 'hmac-md5', 'hmac-sha1-96', 'hmac-md5-96' )
@ -637,6 +637,7 @@ 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))
@ -1399,6 +1400,7 @@ 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))