HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/asyncssh/__pycache__/saslprep.cpython-310.pyc
o

�hX�@s�dZddlZddlZddlmZmZmZddlmZGdd�de	�Z
deddfd	d
�Zdede
deeegefd
eddeeege
fde
defdd�Zdedefdd�Zdedefdd�ZdS)z�SASLprep implementation

   This module implements the stringprep algorithm defined in RFC 3454
   and the SASLprep profile of stringprep defined in RFC 4013. This
   profile is used to normalize usernames and passwords sent in the
   SSH protocol.

�N)�Callable�Optional�Sequence)�Literalc@seZdZdZdS)�
SASLPrepErrorz!Invalid data provided to saslprepN)�__name__�
__module__�__qualname__�__doc__�rr�D/usr/local/CyberCP/lib/python3.10/site-packages/asyncssh/saslprep.pyr(sr�s�returncCsvd}d}|D]}|st�|�rd}|st�|�rd}q|r#|r#td��|r7t�|d�r3t�|d�s9td��dSdS)z@Enforce bidirectional character check from RFC 3454 (stringprep)FTz*Both RandALCat and LCat characters presentr���z-RandALCat character not at both start and endN)�
stringprep�in_table_d1�in_table_d2r)r
�r_and_al_cat�l_cat�crrr�_check_bidi,s���r�check_unassigned�mapping�
normalization)�NFC�NFD�NFKC�NFKD�
prohibited�bidicCs�|r|D]}t�|�rtd|����q|r||�}|r!t�||�}|r8|D]}|D]
}||�r6td|����q)q%|r>t|�|S)z5Implement a stringprep profile as defined in RFC 3454zUnassigned character: zProhibited character: )r�in_table_a1r�unicodedata�	normalizer)r
rrrrrr�lookuprrr�_stringprepAs&
���r$cCsBg}|D]}t�|�r|�d�qt�|�s|�|�qd�|�S)z<Map stringprep table B.1 to nothing and C.1.2 to ASCII space� �)r�in_table_c12�append�in_table_b1�join)r
�rrrrr�
_map_saslprep_s


�
r,c	Cs:tjtjtjtjtjtjtjtjtj	f	}t
|dtd|d�S)z.Implement SASLprep profile defined in RFC 4013Tr)rr'�in_table_c21_c22�in_table_c3�in_table_c4�in_table_c5�in_table_c6�in_table_c7�in_table_c8�in_table_c9r$r,)r
rrrr�saslprepms�r5)r
rr!�typingrrr�typing_extensionsr�
ValueErrorr�strr�boolr$r,r5rrrr�<module>s(
����
�