diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2013-09-20 13:18:26 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2013-09-20 13:19:01 -0700 |
commit | 565eff8274063aa118b9cbe0231766a420de79f3 (patch) | |
tree | 10b83deac4cbb81ee618ab6b08943c98c4a9c2d2 | |
parent | 965d00dee951ffaee7458c7f8cb0a3c38ff46b25 (diff) |
Apply slightly modified version of patch from #162
-rw-r--r-- | paramiko/packet.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/paramiko/packet.py b/paramiko/packet.py index 38a6d4b5..be502e9b 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): |