HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/__pycache__/saslprep.cpython-310.pyc
o

�N�g��	@stdZzddlZWneydZdd�ZYdSwdZddlZejejejej	ej
ejejej
ejf	Zddd�ZdS)	z&An implementation of RFC4013 SASLprep.�NFcCst|t�r	td��|S)zSASLprep dummyzVThe stringprep module is not available. Usernames and passwords must be ASCII strings.)�
isinstance�str�	TypeError)�data�r�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/saslprep.py�saslpreps

�rTcs�t|t�s|S|rttjf}nt}tj�tj�d���fdd�|D��}tj	�
d|�}tj}||d�rF||d�s?td��|tj
f}n||f}|D]�t�fdd	�|D��r^td
��qM|S)a�An implementation of RFC4013 SASLprep.

        :Parameters:
          - `data`: The string to SASLprep. Unicode strings
            (python 2.x unicode, 3.x str) are supported. Byte strings
            (python 2.x str, 3.x bytes) are ignored.
          - `prohibit_unassigned_code_points`: True / False. RFC 3454
            and RFCs for various SASL mechanisms distinguish between
            `queries` (unassigned code points allowed) and
            `stored strings` (unassigned code points prohibited). Defaults
            to ``True`` (unassigned code points are prohibited).

        :Returns:
        The SASLprep'ed version of `data`.
        �cs$g|]}�|�s�|�rdn|�qS)� r)�.0�elt)�in_table_b1�in_table_c12rr�
<listcomp>Ps�zsaslprep.<locals>.<listcomp>�NFKCr���z$SASLprep: failed bidirectional checkc3s�|]}|��VqdS)Nr)rZin_table)�charrr�	<genexpr>is�zsaslprep.<locals>.<genexpr>z+SASLprep: failed prohibited character check)rr�_PROHIBITED�
stringprepZin_table_a1rr
�join�unicodedata�	ucd_3_2_0�	normalize�in_table_d1�
ValueErrorZin_table_d2�any)rZprohibit_unassigned_code_pointsZ
prohibitedrr)rr
rrr1s4
��
��)T)�__doc__r�ImportErrorZHAVE_STRINGPREPrrrZin_table_c21_c22Zin_table_c3Zin_table_c4Zin_table_c5Zin_table_c6Zin_table_c7Zin_table_c8Zin_table_c9rrrrr�<module>s(��