File: //proc/thread-self/root/lib/python3/dist-packages/twisted/conch/__pycache__/checkers.cpython-38.pyc
U
��W[M � @ s" d Z ddlmZmZ ddlZddlZddlZzddlZW n ek
rP dZY n
X ddl Z zddl
Z
W n ek
r~ dZ
Y nX ddlmZm
Z
mZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZmZ dd
lmZmZ ddlmZ ddlm Z m!Z!m"Z" dd
l#m$Z$m%Z%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z, dd� Z-dd� Z.dd� Z/e
e�G dd� d��Z0e
e�G dd� d��Z1e
e�G dd� d��Z2e(edddd�de3d� G d d!� d!e�Z4ej5j6fd"d#�Z7d$d%� Z8e
e4�G d&d'� d'e9��Z:e
e4�G d(d)� d)e9��Z;e
e�G d*d+� d+e9��Z<dS ),zO
Provide L{ICredentialsChecker} implementations to be used in Conch protocols.
� )�absolute_import�divisionN)�
providedBy�implementer� Interface)�Version)�error)�keys)�ICredentialsChecker)�IUsernamePassword�ISSHPrivateKey)�UnauthorizedLogin�UnhandledCredentials)�defer)�_keys�_PY3�_b64decodebytes)�failure�reflect�log)�deprecatedModuleAttribute)�runAsEffectiveUser)�FilePathc C s t � || �| kS )z�
Check that the password, when crypted, matches the stored crypted password.
@param crypted: The stored crypted password.
@type crypted: L{str}
@param pw: The password the user has given.
@type pw: L{str}
@rtype: L{bool}
)�crypt)�cryptedZpw� r �8/usr/lib/python3/dist-packages/twisted/conch/checkers.py�verifyCryptedPassword. s r c C s t dkrdS t �| �S )a
Look up a user in the /etc/passwd database using the pwd module. If the
pwd module is not available, return None.
@param username: the username of the user to return the passwd database
information for.
@type username: L{str}
N)�pwd�getpwnam)�usernamer r r �
_pwdGetByName= s r! c C s"