diff options
author | Jeremy T. Bouse <jbouse@debian.org> | 2014-02-14 21:29:59 -0500 |
---|---|---|
committer | Jeremy T. Bouse <jbouse@debian.org> | 2014-02-14 21:29:59 -0500 |
commit | 3f4d155d984fd27cedd0a333bf44e4724f33e30a (patch) | |
tree | ee06fc2a9ec6c5f144015dcbd67763f539d9aa51 /paramiko/packet.py | |
parent | d45f78c1381a1f583306c5b6a89989f478980c2f (diff) | |
parent | 3bb46c9cb414ca82afab715d2d0cc00ed71cfb6d (diff) | |
download | python-paramiko-3f4d155d984fd27cedd0a333bf44e4724f33e30a.tar python-paramiko-3f4d155d984fd27cedd0a333bf44e4724f33e30a.tar.gz |
Merge tag 'upstream/1.12.2'
Upstream version 1.12.2
Diffstat (limited to 'paramiko/packet.py')
-rw-r--r-- | paramiko/packet.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/paramiko/packet.py b/paramiko/packet.py index 38a6d4b..6ab7363 100644 --- a/paramiko/packet.py +++ b/paramiko/packet.py @@ -7,7 +7,7 @@ # Software Foundation; either version 2.1 of the License, or (at your option) # any later version. # -# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY +# Paramiko is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. @@ -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): @@ -156,7 +152,6 @@ class Packetizer (object): def close(self): self.__closed = True - self.__socket.close() def set_hexdump(self, hexdump): self.__dump_packets = hexdump |