def test_unexpected_global_response(self): """Test unexpected global response""" conn = yield from self.connect() conn.send_packet(MSG_GLOBAL_REQUEST, String('xxx'), Boolean(True)) yield from conn.wait_closed()
def test_unexpected_userauth_failure(self): """Test unexpected userauth failure response""" conn = yield from self.connect() conn.send_packet(MSG_USERAUTH_FAILURE, NameList([]), Boolean(False)) yield from conn.wait_closed()
def test_invalid_global_request(self): """Test invalid global request""" conn = yield from self.connect() conn.send_packet(MSG_GLOBAL_REQUEST, String(b'\xff'), Boolean(True)) yield from conn.wait_closed()
def password_auth_requested(self): """Attempt to execute a command before authentication is complete""" # pylint: disable=protected-access self._conn._auth_complete = True self._conn.send_packet(MSG_GLOBAL_REQUEST, String(b'\xff'), Boolean(True)) return 'pw'
def test_no_matching_host_key_algs(self): """Test no matching server host key algorithms""" conn = yield from self.connect() conn.send_packet(MSG_KEXINIT, os.urandom(16), NameList([b'ecdh-sha2-nistp521']), NameList([b'xxx']), NameList([]), NameList([]), NameList([]), NameList([]), NameList([]), NameList([]), NameList([]), NameList([]), Boolean(False), UInt32(0)) yield from conn.wait_closed()
def test_no_matching_kex_algs(self): """Test no matching key exchange algorithms""" conn = yield from self.connect() conn.send_packet(MSG_KEXINIT, os.urandom(16), NameList([b'xxx']), NameList([]), NameList([]), NameList([]), NameList([]), NameList([]), NameList([]), NameList([]), NameList([]), NameList([]), Boolean(False), UInt32(0)) yield from conn.wait_closed()
def simulate_gss_complete(self, f, sig): """Simulate receiving a GSS complete packet""" self.process_packet(b''.join((Byte(MSG_KEXGSS_COMPLETE), MPInt(f), String(sig), Boolean(False))))
def send_userauth_failure(self, partial_success): """Send a user authentication failure response""" self._auth = None self.send_packet(MSG_USERAUTH_FAILURE, NameList([]), Boolean(partial_success))
def make_x11_forwarding_request(self, proto, data, screen): """Make a request to enable X11 forwarding""" return (yield from self._make_request(b'x11-req', Boolean(False), String(proto), String(data), UInt32(screen)))