コード例 #1
0
ファイル: test_auth.py プロジェクト: yyaan/asyncssh
    def __init__(self, method, gss_host=None, override_gss_mech=False,
                 public_key_auth=False, client_key=None, client_cert=None,
                 override_pk_ok=False, password_auth=False, password=None,
                 password_change=NotImplemented, password_change_prompt=None,
                 kbdint_auth=False, kbdint_submethods=None,
                 kbdint_challenge=None, kbdint_response=None, success=False):
        super().__init__(_AuthServerStub(self, gss_host, override_gss_mech,
                                         public_key_auth, override_pk_ok,
                                         password_auth, password_change_prompt,
                                         kbdint_auth, kbdint_challenge,
                                         success), False)

        self._gss = GSSClient(gss_host, False) if gss_host else None

        self._client_key = client_key
        self._client_cert = client_cert

        self._password = password
        self._password_change = password_change
        self._password_changed = None

        self._kbdint_submethods = kbdint_submethods
        self._kbdint_response = kbdint_response

        self._auth_waiter = asyncio.Future()
        self._auth = lookup_client_auth(self, method)

        if self._auth is None:
            self.close()
            raise ValueError('Invalid auth method')
コード例 #2
0
    def __init__(self, alg, gss_host):
        server_conn = _KexServerStub(alg, gss_host, self)

        if gss_host:
            gss = GSSClient(gss_host, 'delegate' in gss_host)
        else:
            gss = None

        super().__init__(alg, gss, server_conn)
コード例 #3
0
    def __init__(self, alg, gss_host):
        server_conn = _KexServerStub(alg, gss_host, self)

        try:
            if gss_host:
                gss = GSSClient(gss_host, 'delegate' in gss_host)
            else:
                gss = None

            super().__init__(alg, gss, server_conn)
        except DisconnectError:
            server_conn.close()
            raise