diff options
-rw-r--r-- | paramiko/kex_group1.py | 1 | ||||
-rw-r--r-- | paramiko/kex_group14.py | 2 | ||||
-rw-r--r-- | paramiko/transport.py | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/paramiko/kex_group1.py b/paramiko/kex_group1.py index a88f00d2..9eee066c 100644 --- a/paramiko/kex_group1.py +++ b/paramiko/kex_group1.py @@ -45,6 +45,7 @@ class KexGroup1(object): G = 2 name = 'diffie-hellman-group1-sha1' + hash_algo = sha1 def __init__(self, transport): self.transport = transport diff --git a/paramiko/kex_group14.py b/paramiko/kex_group14.py index a914aeaf..9f7dd216 100644 --- a/paramiko/kex_group14.py +++ b/paramiko/kex_group14.py @@ -22,6 +22,7 @@ Standard SSH key exchange ("kex" if you wanna sound cool). Diffie-Hellman of """ from paramiko.kex_group1 import KexGroup1 +from hashlib import sha1 class KexGroup14(KexGroup1): @@ -31,3 +32,4 @@ class KexGroup14(KexGroup1): G = 2 name = 'diffie-hellman-group14-sha1' + hash_algo = sha1 diff --git a/paramiko/transport.py b/paramiko/transport.py index e2a0c0ff..d2fccf07 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -1534,7 +1534,7 @@ class Transport (threading.Thread, ClosingContextManager): m.add_bytes(self.H) m.add_byte(b(id)) m.add_bytes(self.session_id) - hash_algo = self._mac_info[self.local_mac]['class'] if self.local_mac else sha1 + hash_algo = self.kex_engine.hash_algo out = sofar = hash_algo(m.asbytes()).digest() while len(out) < nbytes: m = Message() |