File: //usr/lib/python3/dist-packages/twisted/plugins/__pycache__/cred_unix.cpython-310.pyc
o
�b? � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m
Z
ddlmZ ddl
mZ d d
� Zee�G dd� d��Zd
Zeeej�G dd� d��Ze� ZdS )z%
Cred plugin for UNIX user accounts.
� )�implementer)�plugin)�ICredentialsChecker)�IUsernamePassword)�UnauthorizedLogin)�ICheckerFactory)�deferc C s� zddl }W n ty d}Y nw |du rtd��t|t�r$|�d�}t| t�r.| �d�} z|� || �}t|t�r?|�d�}|| kW S tyM Y dS w )a�
Use L{crypt.crypt} to Verify that an unencrypted
password matches the encrypted password.
@param crypted: The encrypted password, obtained from
the Unix password database or Unix shadow
password database.
@param pw: The unencrypted password.
@return: L{True} if there is successful match, else L{False}.
@rtype: L{bool}
r Nz(cred_unix not supported on this platform�utf-8F)�crypt�ImportError�NotImplementedError�
isinstance�bytes�decode�OSError)�crypted�pwr
�
crypted_check� r �;/usr/lib/python3/dist-packages/twisted/plugins/cred_unix.py�verifyCryptedPassword s&