diff --git a/NEWS b/NEWS index d302d479af765d013b506eea0317cd60386db4d2_TkVXUw==..2cd511bd747079843798ba4eacd738a49a519045_TkVXUw== 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,13 @@ 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.11.0 (26th Jul 2013) ----------------------- diff --git a/paramiko/packet.py b/paramiko/packet.py index d302d479af765d013b506eea0317cd60386db4d2_cGFyYW1pa28vcGFja2V0LnB5..2cd511bd747079843798ba4eacd738a49a519045_cGFyYW1pa28vcGFja2V0LnB5 100644 --- a/paramiko/packet.py +++ b/paramiko/packet.py @@ -33,5 +33,4 @@ from paramiko.message import Message -got_r_hmac = False try: @@ -37,4 +36,3 @@ try: - import r_hmac - got_r_hmac = True + from r_hmac import HMAC except ImportError: @@ -40,3 +38,4 @@ except ImportError: - pass + from Crypto.Hash.HMAC import HMAC + def compute_hmac(key, message, digest_class): @@ -42,8 +41,5 @@ 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):