[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:
parent
25d55e6089
commit
b1d58c5ceb
|
@ -140,13 +140,14 @@ class DSSKey (PKey):
|
||||||
@param bits: number of bits the generated key should be.
|
@param bits: number of bits the generated key should be.
|
||||||
@type bits: int
|
@type bits: int
|
||||||
@param progress_func: an optional function to call at key points in
|
@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
|
@type progress_func: function
|
||||||
@return: new private key
|
@return: new private key
|
||||||
@rtype: L{DSSKey}
|
@rtype: L{DSSKey}
|
||||||
|
|
||||||
@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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue