Exemplo n.º 1
0
    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')
Exemplo n.º 2
0
    def __init__(self, method, 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, public_key_auth, override_pk_ok,
                                         password_auth, password_change_prompt,
                                         kbdint_auth, kbdint_challenge,
                                         success), False)

        self._client_key = read_private_key(client_key) if client_key else None
        self._client_cert = read_certificate(client_cert) if client_cert \
                                else None

        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()
            self._peer.close()
            raise ValueError('Invalid auth method')
Exemplo n.º 3
0
    def __init__(self, method, gss_host=None, override_gss_mech=False,
                 host_based_auth=False, client_host_key=None,
                 client_host_cert=None, 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,
                                         host_based_auth, 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_host_key = client_host_key
        self._client_host_cert = client_host_cert

        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')
Exemplo n.º 4
0
    def __init__(self,
                 method,
                 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, public_key_auth, override_pk_ok,
                            password_auth, password_change_prompt, kbdint_auth,
                            kbdint_challenge, success), False)

        self._client_key = read_private_key(client_key) if client_key else None
        self._client_cert = read_certificate(client_cert) if client_cert \
                                else None

        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()
            self._peer.close()
            raise ValueError('Invalid auth method')