From b1d58c5cebbb1a2a847bb20045c5b981f2f99c5b Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Mon, 31 Oct 2005 03:27:13 +0000 Subject: [PATCH] [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-76] add a few more randpool.stir() calls --- paramiko/dsskey.py | 3 ++- paramiko/rsakey.py | 1 + paramiko/transport.py | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/paramiko/dsskey.py b/paramiko/dsskey.py index 35bf08c..2b31372 100644 --- a/paramiko/dsskey.py +++ b/paramiko/dsskey.py @@ -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 diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py index 7e6b07e..780ea1b 100644 --- a/paramiko/rsakey.py +++ b/paramiko/rsakey.py @@ -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 diff --git a/paramiko/transport.py b/paramiko/transport.py index 9f095cb..9609773 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -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))