summaryrefslogtreecommitdiffhomepage
path: root/tests/test_packetizer.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-04-14 10:56:05 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2014-04-14 10:56:05 -0400
commit191fd465f166588922ccbf08b65d4479d8520d6a (patch)
tree673a3ad36d919009d2621b6e1d3b102cf7988aa9 /tests/test_packetizer.py
parent6c6969c1882e62d6249264d2df46ff452eb53e7e (diff)
parentfa86d655dc8f08eb9171930c41b508e2bee08b08 (diff)
Merge branch 'master' into use-urandom
Conflicts: paramiko/dsskey.py paramiko/ecdsakey.py paramiko/hostkeys.py paramiko/kex_gex.py paramiko/kex_group1.py paramiko/pkey.py paramiko/primes.py paramiko/rsakey.py tests/test_pkey.py
Diffstat (limited to 'tests/test_packetizer.py')
-rw-r--r--tests/test_packetizer.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_packetizer.py b/tests/test_packetizer.py
index d4d5544e..a8c0f973 100644
--- a/tests/test_packetizer.py
+++ b/tests/test_packetizer.py
@@ -21,9 +21,12 @@ Some unit tests for the ssh2 protocol in Transport.
"""
import unittest
+from hashlib import sha1
+
from tests.loop import LoopSocket
+
from Crypto.Cipher import AES
-from Crypto.Hash import SHA
+
from paramiko import Message, Packetizer, util
from paramiko.common import byte_chr, zero_byte
@@ -41,7 +44,7 @@ class PacketizerTest (unittest.TestCase):
p.set_log(util.get_logger('paramiko.transport'))
p.set_hexdump(True)
cipher = AES.new(zero_byte * 16, AES.MODE_CBC, x55 * 16)
- p.set_outbound_cipher(cipher, 16, SHA, 12, x1f * 20)
+ p.set_outbound_cipher(cipher, 16, sha1, 12, x1f * 20)
# message has to be at least 16 bytes long, so we'll have at least one
# block of data encrypted that contains zero random padding bytes
@@ -64,7 +67,7 @@ class PacketizerTest (unittest.TestCase):
p.set_log(util.get_logger('paramiko.transport'))
p.set_hexdump(True)
cipher = AES.new(zero_byte * 16, AES.MODE_CBC, x55 * 16)
- p.set_inbound_cipher(cipher, 16, SHA, 12, x1f * 20)
+ p.set_inbound_cipher(cipher, 16, sha1, 12, x1f * 20)
wsock.send(b'\x43\x91\x97\xbd\x5b\x50\xac\x25\x87\xc2\xc4\x6b\xc7\xe9\x38\xc0\x90\xd2\x16\x56\x0d\x71\x73\x61\x38\x7c\x4c\x3d\xfb\x97\x7d\xe2\x6e\x03\xb1\xa0\xc2\x1c\xd6\x41\x41\x4c\xb4\x59')
cmd, m = p.read_message()
self.assertEqual(100, cmd)