Exemplo n.º 1
0
 def test_2_read(self):
     rsock = LoopSocket()
     wsock = LoopSocket()
     rsock.link(wsock)
     p = Packetizer(rsock)
     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, 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)
     self.assertEqual(100, m.get_int())
     self.assertEqual(1, m.get_int())
     self.assertEqual(900, m.get_int())
Exemplo n.º 2
0
 def test_2_read(self):
     rsock = LoopSocket()
     wsock = LoopSocket()
     rsock.link(wsock)
     p = Packetizer(rsock)
     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)
     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)
     self.assertEqual(100, m.get_int())
     self.assertEqual(1, m.get_int())
     self.assertEqual(900, m.get_int())
 def test_2_read (self):
     rsock = LoopSocket()
     wsock = LoopSocket()
     rsock.link(wsock)
     p = Packetizer(rsock)
     p.set_log(util.get_logger('paramiko.transport'))
     p.set_hexdump(True)
     cipher = AES.new('\x00' * 16, AES.MODE_CBC, '\x55' * 16)
     p.set_inbound_cipher(cipher, 16, SHA, 12, '\x1f' * 20)
     
     wsock.send('C\x91\x97\xbd[P\xac%\x87\xc2\xc4k\xc7\xe98\xc0' + \
                '\x90\xd2\x16V\rqsa8|L=\xfb\x97}\xe2n\x03\xb1\xa0\xc2\x1c\xd6AAL\xb4Y')
     cmd, m = p.read_message()
     self.assertEquals(100, cmd)
     self.assertEquals(100, m.get_int())
     self.assertEquals(1, m.get_int())
     self.assertEquals(900, m.get_int())
Exemplo n.º 4
0
    def test_2_read(self):
        rsock = LoopSocket()
        wsock = LoopSocket()
        rsock.link(wsock)
        p = Packetizer(rsock)
        p.set_log(util.get_logger('paramiko.transport'))
        p.set_hexdump(True)
        cipher = AES.new('\x00' * 16, AES.MODE_CBC, '\x55' * 16)
        p.set_inbound_cipher(cipher, 16, SHA, 12, '\x1f' * 20)

        wsock.send('C\x91\x97\xbd[P\xac%\x87\xc2\xc4k\xc7\xe98\xc0' + \
                   '\x90\xd2\x16V\rqsa8|L=\xfb\x97}\xe2n\x03\xb1\xa0\xc2\x1c\xd6AAL\xb4Y')
        cmd, m = p.read_message()
        self.assertEquals(100, cmd)
        self.assertEquals(100, m.get_int())
        self.assertEquals(1, m.get_int())
        self.assertEquals(900, m.get_int())
Exemplo n.º 5
0
 def test_2_read(self):
     rsock = LoopSocket()
     wsock = LoopSocket()
     rsock.link(wsock)
     p = Packetizer(rsock)
     p.set_log(util.get_logger("paramiko.transport"))
     p.set_hexdump(True)
     decryptor = Cipher(algorithms.AES(zero_byte * 16), modes.CBC(x55 * 16), backend=default_backend()).decryptor()
     p.set_inbound_cipher(decryptor, 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)
     self.assertEqual(100, m.get_int())
     self.assertEqual(1, m.get_int())
     self.assertEqual(900, m.get_int())
Exemplo n.º 6
0
 def test_2_read(self):
     rsock = LoopSocket()
     wsock = LoopSocket()
     rsock.link(wsock)
     p = Packetizer(rsock)
     p.set_log(util.get_logger('paramiko.transport'))
     p.set_hexdump(True)
     decryptor = Cipher(algorithms.AES(zero_byte * 16),
                        modes.CBC(x55 * 16),
                        backend=default_backend()).decryptor()
     p.set_inbound_cipher(decryptor, 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)
     self.assertEqual(100, m.get_int())
     self.assertEqual(1, m.get_int())
     self.assertEqual(900, m.get_int())