From 565eff8274063aa118b9cbe0231766a420de79f3 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 20 Sep 2013 13:18:26 -0700 Subject: [PATCH 1/2] Apply slightly modified version of patch from #162 --- paramiko/packet.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/paramiko/packet.py b/paramiko/packet.py index 38a6d4b..be502e9 100644 --- a/paramiko/packet.py +++ b/paramiko/packet.py @@ -33,17 +33,13 @@ from paramiko.ssh_exception import SSHException, ProxyCommandFailure from paramiko.message import Message -got_r_hmac = False try: - import r_hmac - got_r_hmac = True + from r_hmac import HMAC except ImportError: - pass + from Crypto.Hash.HMAC import HMAC + def compute_hmac(key, message, digest_class): - if got_r_hmac: - return r_hmac.HMAC(key, message, digest_class).digest() - from Crypto.Hash import HMAC - return HMAC.HMAC(key, message, digest_class).digest() + return HMAC(key, message, digest_class).digest() class NeedRekeyException (Exception): From f7d74d03d9f1f6ec10b0f7df3061384afdb61b48 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 20 Sep 2013 13:44:28 -0700 Subject: [PATCH 2/2] Changelog entry re #162 --- NEWS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 0ad9f6b..d052ebb 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,13 @@ Issues noted as "Fabric #NN" can be found at https://github.com/fabric/fabric/. Releases ======== +v1.10.3 (20th Sep 2013) +----------------------- + +* #162: Clean up HMAC module import to avoid deadlocks in certain uses of + SSHClient. Thanks to Gernot Hillier for the catch & suggested + fix. + v1.10.2 (26th Jul 2013) -----------------------