Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
sasl.cpython-313.pyc28 linesDownload Raw Back to __pycache__
1�

2��j���~�SrSSKrSSKJr SSKJr SSKJr SSK	J3r4 SSKJr SS	K
JrJr S5rSSjrSrS
rSrg)�6�N)�	ucd_3_2_0)�urandom)�hexlify�)�SASL)� RESULT_AUTH_METHOD_NOT_SUPPORTED)�LDAPSASLPrepError�LDAPPasswordIsMandatoryErrorc�d�SnUHFn[R"U5(aUS-
nM%[R"U5(aMBX-
nMH [R"SU5nU(d[S5eUGH�n[R"U5(a[S5e[R"U5(a[S5e[R"U5(a[S5e[R"U5(a[S5e[R"U5(a[S	5e[R"U5(a[S75e[R"U5(a[S5e[R"U5(a[S5e[R"U5(a[S
5e[R"U5(dGMx[S5e SnSnUHYn[R"U5(aSnO[R "U5(aSnU(dMGU(dMP[S5e U(aG[R"US5(d)[R "US5(d[S5eU$)af8implement SASLPrep profile as per RFC4013:9it defines the "SASLprep" profile of the "stringprep" algorithm [StringPrep].10The profile is designed for use in Simple Authentication and Security11Layer ([SASL]) mechanisms, such as [PLAIN], [CRAM-MD5], and12[DIGEST-MD5].  It may be applicable where simple user names and13passwords are used.  This profile is not intended for use in14preparing identity strings that are not simple user names (e.g.,15email addresses, domain names, distinguished names), or where16identity or password strings that are not character data, or require17different handling (e.g., case folding).18�� �NFKCz*SASLprep error: unable to normalize stringz1SASLprep error: non-ASCII space character presentz/SASLprep error: ASCII control character presentz3SASLprep error: non-ASCII control character presentz)SASLprep error: private character presentz0SASLprep error: non-character code point presentz,SASLprep error: surrogate code point presentz>SASLprep error: inappropriate for plain text character presentzLSASLprep error: inappropriate for canonical representation character presentzGSASLprep error: change display property or deprecated character presentz)SASLprep error: tagging character presentFTzISASLprep error: string cannot contain (R or AL) and L bidirectional charsr�����zNr_and_al_cat character present, must be first and last character of the string)�19stringprep�in_table_c12�in_table_b1�	unicode32�	normalizer20�in_table_c21�in_table_c22�in_table_c3�in_table_c4�in_table_c5�in_table_c6�in_table_c7�in_table_c8�in_table_c9�in_table_d1�in_table_d2)�data�
prepared_data�c�flag_r_and_al_cat�21flag_l_cats     �^D:\code\apps\devtools\python\user_packages\Python313\site-packages\ldap3/protocol/sasl/sasl.py�	sasl_prepr'$s:���M�
���"�"�1�%�%��S� �M�
�
#�
#�A�
&�
&����M���'�'��
�>�M��� L�M�M����"�"�1�%�%�#�$W�X�X�
�
$�
$�Q�
'�
'�#�$U�V�V�
�
$�
$�Q�
'�
'�#�$Y�Z�Z�
�
#�
#�A�
&�
&�#�$O�P�P�
�
#�
#�A�
&�
&�#�$V�W�W�
�
#�
#�A�
&�
&�#�$R�S�S�
�
#�
#�A�
&�
&�#�$d�e�e�
�
#�
#�A�
&�
&�#�$r�s�s�
�
#�
#�A�
&�
&�#�$m�n�n�
�
#�
#�A�
&�
&�#�$O�P�P�=�D���J�
���!�!�!�$�$� $��
�
#�
#�A�
&�
&��J�����#�$o�p�p����!7�!7�
�a�8H�!I�!I�R\�Rh�Rh�iv�wy�iz�R{�R{�� p�q�q���c���U(a	U(dU$U(d[S5e[U[5(d1[U5n[U[5(dUR	S5nU$)z:22validate simple password as per RFC4013 using sasl_prep:23zsimple password can't be emptyzutf-8)r�24isinstance�bytesr'�encode)�password�accept_emptys  r&�validate_simple_passwordr/}sT��25�H���
�*�+K�L�L��h��&�&��X�&���(�E�*�*����w�/�H��Or(c�&�SSKJn U"UR[SSSS5nUR	URSX155nURR(a
URnOURU5SSnUS[:XaS$S$)	Nr��bind_operationr
�bindRequestr�resultTF)�operation.bindr2�versionr�post_send_single_response�send�strategy�syncr4�get_responser	)�26connection�controlsr2�request�responser4s      r&�abort_sasl_negotiationr@�s���0��Z�/�/��t�T�2�t�L�G��3�3�J�O�O�M�SZ�4e�f�H�������"�"���(�(��2�1�5�a�8���(�#�'G�G�4�R�U�Rr(c��SSKJn U"UR[SSURU5nURUR
SXA55nURR(aURnU$URU5upvU$)Nrr1r3)r5r2r6r�sasl_mechanismr7r8r9r:r4r;)r<r=�payloadr2r>r?r4�_s        r&�send_sasl_negotiationrE�s|��0��Z�/�/��t�T�:�C\�C\�^e�f�G��3�3�J�O�O�M�SZ�4e�f�H�������"�"���M��+�+�H�5�	���Mr(c�Z�[[[U55RS55$)N�ascii)�strrr�decode)�sizes r&�random_hex_stringrK�s!���w�w�t�}�%�,�,�W�5�6�6r()F)�__doc__r�unicodedatarr�osr�binasciirr
r�core.resultsr	�core.exceptionsr27rr'r/r@rErK�r(r&�<module>rSs=���2�.����<�N�V�r�$28S��7r(
codekingpro/portable-devtools · Team Ai