__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

XR_2#��<�SrSSKJr SSKJr \(aSSKJr OSSKJr SSKrSSK	J
r
 SSKr\R"\
5rSSKrSSKrSSKJr SSKJrJr SS	KJrJr SS
KJrJr SSKJrJrJrJrJ r J!r! SSK"J#s J$r% SSK&J'r'J(r(J)r)J*r*J+r+J,r, SS
K-J.r.J/r0J1r2J3r3 \RhRk\RhRm\755r8Sr9"SS\'5r:SSK;r;SSK<r<"SS\%Rz5r>"SS\%Rz5r?"SS\'5r@g)ztests for passlib.context�)�with_statement)�PY3)�NoSectionErrorN)�partial)�hash)�CryptContext�LazyCryptContext)�PasslibConfigWarning�PasslibHashWarning)�tick�
to_unicode)�irange�u�unicode�
str_to_uascii�PY2�PY26)�TestCase�set_file�TICK_RESOLUTION�
quicksleep�	time_call�handler_derived_from)�register_crypt_handler_path�_has_crypt_handler�_unload_handler_name�get_crypt_handlerc��UR5nUHnURU5 M U(aURU5 U$�N)�copy�update)�first�args�kwds�target�args     �</usr/lib/python3/dist-packages/passlib/tests/test_context.py�merge_dictsr(&s7��
�Z�Z�\�F����
�
�c�����
�
�d���M�c�^�\rSrSrSr/SQr\VVVs/sHn[
U5PM snnnr\"\SSSSSS	S
9r	\
"\	\S9r\"S5r
\"S
5r\R R#\S5r\R)\"S5\"S55r\R R#\S5r\R)\"S5\"S55R/S5r\R R#\S5r\"SSSSS9rSr\
"\	\5r\"SS9r\
"\\5r\"/SQS/S S!S"S#S$S%S$S&S'S(9r U4S)jr!S*r"S+r#S,r$S-r%S.r&S/r'S0r(S1r)S2r*S3r+S4r,S5r-S6r.STS8jr/S9r0S:r1S;r2S<r3S=r4S>r5S704S7S?S04S@04SA04/r6SBr7SCr8SDr9SEr:SUSFjr;SGr<SHr=SIr>SJr?SKr@SLrASMrBSNrCSOrDSPrESQrFSRrGSSrHSArIU=rJ$s snnnf)V�CryptContextTest�1r)�	des_crypt�	md5_crypt�
bsdi_crypt�sha512_cryptr.皙�����?i1ui�aiP��@�)�schemes�default�all__vary_rounds�bsdi_crypt__max_rounds�bsdi_crypt__default_rounds�sha512_crypt__max_rounds�sha512_crypt__min_rounds�r3a[passlib]
schemes = des_crypt, md5_crypt, bsdi_crypt, sha512_crypt
default = md5_crypt
; this is using %...
all__vary_rounds = 10%%
bsdi_crypt__default_rounds = 25001
bsdi_crypt__max_rounds = 30001
sha512_crypt__max_rounds = 50000
sha512_crypt__min_rounds = 40000
z�[passlib]
schemes = des_crypt, md5_crypt, bsdi_crypt, sha512_crypt
default = md5_crypt
all__vary_rounds = 0.1
bsdi_crypt__default_rounds = 25001
bsdi_crypt__max_rounds = 30001
sha512_crypt__max_rounds = 50000
sha512_crypt__min_rounds = 40000

zsample1.cfg�
z
zsample1b.cfg�	[passlib]z
[mypolicy]�utf-16zsample1c.cfgiIqi��iyiȯ)�bsdi_crypt__min_roundsr6r7r9z�[passlib]
bsdi_crypt__min_rounds = 29001
bsdi_crypt__max_rounds = 35001
bsdi_crypt__default_rounds = 31001
sha512_crypt__min_rounds = 45000
r0�r4)r-r.�phpassr/�sha256_cryptr-rA��r����H�)r3�
deprecatedr4r6r7�bsdi_crypt__vary_rounds�sha256_crypt__max_rounds�sha256_crypt__min_rounds�sha256_crypt__default_rounds�
phpass__ident�phpass__default_roundsc�>�[[U]5 [R"SS5 [R"SS5 g)N�ignorez The 'all' scheme is deprecated.*z4.*'scheme' keyword is deprecated as of Passlib 1.7.*)�superr+�setUp�warnings�filterwarnings)�self�	__class__s �r'rR�CryptContextTest.setUp�s3���
���+�-�����*L�M�����*`�ar)c��[5nURUR505 [S0URD6nURUR5UR5 [S0URD6nURUR5UR5 [S0UR
D6nURUR5UR
5 [S0URD6nURUR5UR5 [[S5/S9nURUR5S5 g)ztest class constructorrAr:)rAN�)	r�assertEqual�to_dict�
sample_1_dict�sample_1_resolved_dict�
sample_2_dict�
sample_3_dictrr3�rU�ctxs  r'�test_01_constructor�$CryptContextTest.test_01_constructor�s���n����������+��0�T�/�/�0����������(:�(:�;��9�T�8�8�9����������(:�(:�;��0�T�/�/�0����������(:�(:�;��0�T�/�/�0����������(:�(:�;��A�n�$5�#6�7���������(9�:r)c��[R"UR5nURUR	5UR
5 [R"UR5nURUR	5UR
5 [R"URRS55nURUR	5UR
5 [R"UR5nURUR	5UR
5 [R"URSSS9nURUR	5UR
5 UR[[RS5 UR[[RURSS9 g)ztest from_string() constructor�utf-8�mypolicyr=��section�encodingN�fakesection�rh)
r�from_string�sample_1_unicoderZr[r\�sample_1_unnormalized�encode�sample_1b_unicode�sample_1c_bytes�assertRaises�	TypeErrorrr`s  r'�test_02_from_string�$CryptContextTest.test_02_from_string�s]���&�&�t�'<�'<�=����������(:�(:�;��&�&�t�'A�'A�B����������(:�(:�;��&�&�t�'<�'<�'C�'C�G�'L�M����������(:�(:�;��&�&�t�'=�'=�>����������(:�(:�;��&�&�t�';�';�Z�.6�8����������(:�(:�;�	
���)�\�%=�%=�t�D�	
���.�,�*B�*B��/�/��	�	Hr)c�6�[RRUR5(d[	SUR-5e[
R"UR5nURUR5UR5 [
R"UR5nURUR5UR5 [
R"URSSS9nURUR5UR5 UR[[
R[RR[S55 UR[ [
RURSS9 g)	ztest from_path() constructorzcan't find data file: %rrfr=rgzsample1xxx.cfgrjrkN)�os�path�exists�
sample_1_path�RuntimeErrorr�	from_pathrZr[r\�sample_1b_path�sample_1c_pathrr�EnvironmentError�join�hererr`s  r'�test_03_from_path�"CryptContextTest.test_03_from_path�s1���w�w�~�~�d�0�0�1�1��9�D�<N�<N�N�O�O��$�$�T�%7�%7�8����������(:�(:�;��$�$�T�%8�%8�9����������(:�(:�;��$�$�T�%8�%8�*�.6�8����������(:�(:�;�	
���*�L�,B�,B��'�'�,�,�t�-=�>�	@�	
���.�,�*@�*@��,�,�m�	�	Er)c�D�[S0URD6nUR"S0URD6nUR	UR5UR5 UR	UR5UR5 UR"S0URD6nUR	UR5UR5 UR	UR5UR5 UR"S0URD6nUR	UR5UR5 UR5nURXQ5 UR	UR5UR5 UR	UR5UR5 UR"S0URD6 UR	UR5UR5 UR	UR5UR5 g)ztest copy() methodNrY)rr\r r^rZr[�sample_12_dictr_�sample_123_dict�assertIsNotr!)rU�cc1�cc2�cc2b�cc3�cc4s      r'�test_04_copy�CryptContextTest.test_04_copys����0�T�/�/�0���h�h�,��+�+�,����������(:�(:�;���������(;�(;�<��x�x�-�$�,�,�-����������(:�(:�;���������)<�)<�=��h�h�,��+�+�,����������(<�(<�=��h�h�j������"���������(:�(:�;���������(:�(:�;�	�
�
�(�T�'�'�(���������(:�(:�;���������(;�(;�<r)c�d�[S0URD6nUR[U5S5 g)ztest repr()z!^<CryptContext at 0x-?[0-9a-f]+>$NrY)rr\�assertRegex�repr)rUr�s  r'�test_09_repr�CryptContextTest.test_09_repr+s*���0�T�/�/�0������c��$G�Hr)c��[5nURUR5 URUR	5UR5 URUR
5 URUR	5UR5 URUR
R
S55 URUR	5UR5 UR[URS5 [S0URD6nUR0SS9 URUR	5UR5 [5nURUR5 URUR5 URUR	5UR5 g)z test load() / load_path() methodreNT)r!rY)
r�loadr\rZr[rmrorrrsr^r`s  r'�test_10_load�CryptContextTest.test_10_load4sH���n��	����#�#�$���������(:�(:�;�	����&�&�'���������(:�(:�;�	����&�&�-�-�g�6�7���������(:�(:�;�	
���)�S�X�X�t�4��0�T�/�/�0������D��!���������(:�(:�;��n������#�#�$�����#�#�$���������(:�(:�;r)c��[SS/SSS9nUR5nUR[URSS9 URUR5U5 UR[URSS9 URUR5U5 UR[URS	S
9 URUR5U5 g)z$test load() errors restore old stater-rAi�r1)rLr5T)�too__many__key__parts)�fake_context_optioni'�rKN)r�	to_stringrrrsr!rZ�KeyError�
ValueError)rU�cc�results   r'�test_11_load_rollback�&CryptContextTest.test_11_load_rollback_s����;��7�)-� ��������	
���)�R�Y�Y�d��K���������0�
	
���(�B�I�I�4��H���������0�	
���*�b�i�i�%��P���������0r)c��[S0URD6nUR5 URUR	5UR5 [S0URD6nUR"S0UR
D6 URUR	5UR5 UR"S0URD6 URUR	5UR5 [S0URD6nURUR
5 URUR	5UR5 [S0URD6nURUR5 URUR	5UR5 UR[UR005 UR[UR0S/S9 UR[URS5 g)ztest update() methodr-r:NrY)rr\r!rZr[r^r�r_r��sample_2_unicoderrrsr`s  r'�test_12_update�CryptContextTest.test_12_updatews����0�T�/�/�0���
�
����������(:�(:�;��0�T�/�/�0���
�
�(�T�'�'�(���������(;�(;�<�	�
�
�(�T�'�'�(���������(<�(<�=��0�T�/�/�0���
�
�4�%�%�&���������(;�(;�<��0�T�/�/�0���
�
�4�(�(�)���������(;�(;�<�	
���)�S�Z�Z��R�8����)�S�Z�Z��k�]��K�	
���)�S�Z�Z��6r)c�>�SnUR[[SS9 UR[[SS9 UR[[SS9 UR[[SS9 UR[[SS9 UR[[S	S
9 UR"[U40SS0D6 [S&0S
SS.D6nUR	URS5S5 [
SS9nUR	U"SS9U5 UR	U"SS9U5 UR	U"SS9U5 UR	U"S&0SS0D6U5 UR	U"S&0SS0D6U5 [
SS9nUR	U"SS9U5 UR	U"S&0SS0D6U5 [
SS9nUR	U"SS9U5 UR	U"SS9U5 UR	U"S&0SS0D6U5 UR	U"S&0SS0D6U5 [
SS9nUR	U"SS9U5 UR	U"S&0SS0D6U5 [SS/SS 9nUR[URSS!9 UR[[S/S"S#9 UR[[S/S"S$9 g%)'ztest basic option parsingc�4�[S0UD6R5$)NrY�rr[)r$s r'�parse�/CryptContextTest.test_20_options.<locals>.parse�s���'�$�'�/�/�1�1r)r1)�__�x)�default__scheme__)�__option)�default____option)�__scheme__optioni0u)�!category__scheme__option__invalidzadmin.context__schemesr.�md5_crypt,des_cryptr-)r3zadmin.context__default�adminr?)�context__default)�default__context__defaultzcontext.defaultzdefault.context.default��admin__context__defaultzadmin.context.default�r5)�default__all__vary_roundszall.vary_roundszdefault.all.vary_rounds)�admin__all__vary_roundszadmin.all.vary_roundsr@�P)rM)�md5_crypt__ident�xx)r3�des_crypt__salt)r3�	all__saltNrY)rrrsrr�rZ�default_scheme�dictr )rUr�rar�s    r'�test_20_options� CryptContextTest.test_20_options�s���	2�	
���)�\�c��:����)�\�S��I�	
���)�\�C��@����)�\�S��I�	
���)�\�C��H�	
���)�\�>C�	�	E�
	
���(�E�	D�5�k�B�	D��E�(=�7B�D�E������+�+�G�4�k�B��k�*������{�3�V�<������<�f�E������E�v�N�����A�"3�K�!@�A�6�J�����I�";�K�!H�I�6�R��k�:������{�C�V�L�����G�"9�+�!F�G��P��s�+�������4�f�=������=�v�F�����9�"3�C�!8�9�6�B�����A�";�C�!@�A�6�J��c�2������s�;�V�D�����?�"9�#�!>�?��H��H�k�2�#�F�����(�C�H�H�s��C�	
���(�L�;�-�BF�	�	H����(�L�;�-�<@�	�	Br)c���[SS9nURUR5S5 [SS/S9nURUR5S5 [SS9nURUR5S5 [[R[R
/S9nURUR5S5 UR
[[[R/S9 "SS	[R5nUR
[[U/S9 "S
S[R5nUR
[[X3/S9 UR
[[S/S9 g)
z%test 'schemes' context option parsingNr:rYr-r.)r-r.z des_crypt, md5_crypt, c��\rSrSrSrSrg)�2CryptContextTest.test_21_schemes.<locals>.namelessi�NrY��__name__�
__module__�__qualname__�__firstlineno__�name�__static_attributes__rYr)r'�namelessr��s���Dr)r�c��\rSrSrSrSrg)�1CryptContextTest.test_21_schemes.<locals>.dummy_1i�dummy_1rYNr�rYr)r'r�r�s���Dr)r�)�admin__context__schemes)rrZr3rr-r.rrrs�uh�
StaticHandlerr�r�)rUr�r�r�s    r'�test_21_schemes� CryptContextTest.test_21_schemes�s2���$�
'���������r�*��;��"<�
=���������'A�B��";�
<���������'A�B��4�>�>�4�>�>�"B�
C���������'A�B�	
���)�\�B�<L�<L�;M��N�	�r�'�'�	����*�l�X�J��G�	�b�&�&�	����(�L�7�:L��M�	
���(�L�3>�-�	�	Ar)c��SSjn[S/S9nURSS/S9 URU"U5S/5 [S/SS/S9nURU"U5S/5 UR[[[
R/SS/S9 [S/S	QS9nURU"U5SS/5 UR[[S/S/S
9 UR[[S/S/S
9 UR[[SS/SS/S9 UR[[SS/SSS9 UR[[SS/SSS
9 UR[[SS/SSS9 UR[[SS/SSS9 [SS/SS/S9 UR[[SS9 [S/SS/S/S9nURU"U5S/5 URU"US5S/5 URU"US5S/5 [S/SS//S9nURU"U5S/5 URU"US5S/5 URU"US5/5 g)z(test 'deprecated' context option parsingNc��UR5Vs/sH'nURX!5R(dM%UPM) sn$s snfr�r3�handlerrH)ra�categoryr�s   r'�getdep�3CryptContextTest.test_22_deprecated.<locals>.getdeps=��%(�[�[�]�?�]�T��{�{�4�2�=�=��]�?�
?��?s
�$A�Ar.�rHr-r:)rHr3r�)r.r-rA�r3rH)r3�admin__context__deprecated)r3r4rH)r3r4r�)r3r�rH)r3r�r�)r3rHr�r��{)rHr3r��userr�r)	rr!rZrrrsrr.r�r�)rUr�r�s   r'�test_22_deprecated�#CryptContextTest.test_22_deprecateds���	?�
�k�]�
3��
�	�	�;��4�	�5�������[�M�2��k�]�[�+�<V�
W��������k�]�3�	
���)�\�t�~�~�>N�#.��"<�	�	>��%:�Dn�
o��������k�;�%?�@�	
���(�L�;�-�>I�]�	�	L�	
���*�l�#.�-�&1�]�	�	4�	
���*�l�#.��"<�6A�;�5O�	�	Q�	
���*�l�#.��"<�"-�%0�	�	2�	
���*�l�#.��"<�"-�5@�	�	B�	
���*�l�#.��"<�2=�%0�	�	2�	
���*�l�#.��"<�2=�5@�	�	B�	�#.��"<�%0�2=�57�		9�	
���)�\�c��B��k�]�#.��"<�6A�]���	
������k�]�3������F�+�k�]�;������G�,�{�m�<��k�]�#.��"<�57���	
������k�]�3������F�+�k�]�;������G�,�b�1r)c�&�UR[SS9R5[SS95 [SSS/S9nURUR	5S5 [[
RSS/S9nURUR	5S5 [SS/S9nURUR	5S5 URSS9 URUR	5S5 UR[[S/SS9 UR[[SS9 [SSS/SS	9nURUR	5S5 URUR	S
5S5 URUR	S5S5 g)
z%test 'default' context option parsingr.r?r-)r4r3r:r�)r3r4�)r4r3r�r�r�N)rZrr[r�r�rr.r!rrr�rsr`s  r'�test_23_default� CryptContextTest.test_23_defaulthsz��	
����k�:�B�B�D��k�2�	4��;��k�8R�S������+�+�-�{�;��4�>�>�K��;U�V������+�+�-�{�;��K��#=�>������+�+�-�{�;��
�
�k�
�*�����+�+�-�{�;�	
���(�L�;�-�:E�	�	G�	
���)�\�1��=��;�$/��#=�3>�@��	
����+�+�-�{�;�����+�+�F�3�[�A�����+�+�G�4�k�Br)c��SnURU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 URU"S5S5 g)z&test 'vary_rounds' hash option parsingc�6�[US9R5S$)Nr�r5r�)�vs r'r��3CryptContextTest.test_24_vary_rounds.<locals>.parse�s����3�;�;�=�>P�Q�Qr)r1z0.1z10%i��1000N)rZ)rUr�s  r'�test_24_vary_rounds�$CryptContextTest.test_24_vary_rounds�sr��	R�	
����s��S�)�����u��s�+�	
����u��s�+�	
����t��d�+�����v���-r)Nc�6�UR[X5US9 g)N)�msg)�
assertTruer)rUr��baser�s    r'�assertHandlerDerivedFrom�)CryptContextTest.assertHandlerDerivedFrom�s�����,�W�;���Er)c��[5nURUR5S5 URURSS9S5 [S0URD6nURUR5[	UR
55 URURSSS9[	UR55 [URSS9UR5Hup#UR[X#55 M! [S0URD6nURUR5S5 g)ztest schemes() methodrYT��resolve�r��unconfiguredN)rrZr3r\�tuple�sample_1_schemes�sample_1_handlers�zipr�rr^)rUrar��corrects    r'�test_30_schemes� CryptContextTest.test_30_schemes�s���
�n����������+�������T��2�B�7��0�T�/�/�0����������d�.C�.C�(D�E�������T���E�u�T�Mc�Mc�Gd�e�"�3�;�;�t�;�#<�d�>T�>T�U�O�F��O�O�0��A�B� V��0�T�/�/�0����������+r)c�H�[5nUR[UR5 [S0URD6nURUR5S5 URURSSS9[R5 URURSS9[R5 [S0URD6nUR[UR5 [URS9nURUR5S5 g)	ztest default_scheme() methodr.Tr�r�r:r-NrY)rrrr�r�r\rZrr.r�r^r�r`s  r'�test_31_default_scheme�'CryptContextTest.test_31_default_scheme�s���
�n�����(�C�$6�$6�7��0�T�/�/�0������+�+�-�{�;�����+�+�D�t�+�L�d�n�n�]��%�%�c�&8�&8��&8�&F����W��0�T�/�/�0�����(�C�$6�$6�7��4�#8�#8�9������+�+�-�{�;r)c��[5nUR[UR5 UR[URS5 [S
0URD6nURURSS9[R5 URUR5[R5 URURSSS9[R5 URURS5[R5 UR[URS5 [SSS9nURURSS9[R5 URUR5[R5 URURSSS	9[R5 URURSS
9[R5 URURSSS	9[R5 URURSS
9[R5 [(aoURUR[S5SS	9[R5 URUR[S5SS	9[R5 gg)ztest handler() methodr.T)r�r-�mysql323�sha256_crypt,md5_cryptr��staff)r�r��r�r�NrY)
rrrr�r�r\rZrr.r�r-rArrr`s  r'�test_32_handler� CryptContextTest.test_32_handler�s	���n�����(�C�K�K�0����(�C�K�K��=��0�T�/�/�0��������$��7����H��%�%�c�k�k�m�T�^�^�D�	
������[�t��D�d�n�n�U��%�%�c�k�k�+�&>����O�	
���(�C�K�K��<��3�[�Y��������$��7��9J�9J�K��%�%�c�k�k�m�T�5F�5F�G�������g�D��I�4�K\�K\�]��%�%�c�k�k�7�k�&C�T�EV�EV�W�������g�D��I�4�>�>�Z��%�%�c�k�k�7�k�&C�T�EV�EV�W��3����S�[�[�!�G�*�4�[�P�RV�Rc�Rc�d����S�[�[�!�G�*�4�[�P�RV�R`�R`�a�r)c
���SSjn[S/SQSS/SSS	SS
/SSS
S9
nURURRS5 URU"US5[	SSS	S95 URU"USS5[	SSS	S95 URU"USS5[	SS
S95 URU"US5[	SSS95 URU"USS5[	SSS95 URU"USS5[	SSS95 URU"US
5[	SS95 URU"US
S5[	SS95 URU"US
S5[	SSS95 g)z*test internal _get_record_options() methodNc�>�URRX5S$)Nr)�_config�_get_record_options_with_flag)ra�schemer�s   r'�options�1CryptContextTest.test_33_options.<locals>.options�s���;�;�<�<�V�N�q�Q�Qr)T)r0r-r/r0r-r1皙�����?i Nr/皙�����?g333333�?r2)
�truncate_errorr3rHr5rIr8r�r��admin__bsdi_crypt__vary_rounds�admin__sha512_crypt__max_rounds)r�)rH�vary_rounds�
max_roundsr�r�)rr)rHr)r)rrHr)rrZr�
categoriesr�)rUrr�s   r'�test_33_options� CryptContextTest.test_33_options�s���	R�
��B�(�+�6�"�$'�',�+6��)F�&*�+.�.3�
��	
������/�/��<�	
�����n�5�t����8
�	�	
�����n�f�=�t����@
�	�	
�����n�g�>����A
�	�	
�����k�2�D���5
�	�
	
�����k�6�:�D���=
�	�
	
�����k�7�;�T���>
�	�	
�����l�3�T��6
�	�	
�����l�F�;�T��>
�	�	
�����l�G�<�d���?
�	r)c���[S0URD6nURUR5UR5 URURSS9UR5 g)ztest to_dict() methodTr�NrY)rr\rZr[r]r`s  r'�test_34_to_dict� CryptContextTest.test_34_to_dictCsT���0�T�/�/�0����������(:�(:�;�������T��2�D�4O�4O�Pr)c���[S
0URD6nUR5n[(dUR	X R
5 [R"U5nUR	UR5UR5 URSS9nUR	XBRSS55 SSK	J
n [US/5nUR5nURUS5 g	)ztest to_string() methodzpassword-securityrkr<z[password-security]r)�UnsaltedHashr.zM# NOTE: the 'unsalted_test_hash' handler\(s\) are not registered with PasslibNrY)rr\r�rrZrmrlr[�replace�!passlib.tests.test_utils_handlersr"r�)rUra�dump�ctx2�otherr"�ctx3s       r'�test_35_to_string�"CryptContextTest.test_35_to_stringJs����0�T�/�/�0���}�}����t����T�#8�#8�9��'�'��-����������);�);�<��
�
�&9�
�:��������[�9N� O�P�	C��\�;�7�8���~�~������� C�	Dr)rr�rYc	���[R[R[R/n[	USS9nUH�nURSUR
S9nUR
URU5UR
5 UR
URUSSS9U5 URURUSS9U5 URURSU55 URURSU55 M� URS5nUR
URU5S	5 URS
UR55nUR
URU5S	5 URS
UR5S	S9nUR
URU5S	5 UR[URS
UR5SS9 g)
z-test basic hash/identify/verify functionality��r7�test�rTr�r��notestr.�secretr-N)rr.r-r/rr�rZ�identifyr�r��verify�assertFalse�genhash�	genconfigrrr�)rU�handlersr��crypt�hs     r'�
test_40_basic�CryptContextTest.test_40_basicqs}���N�N�D�N�N�D�O�O�D��
�(�q�
A���E�����u�z�z��2�A����R�[�[��^�U�Z�Z�8����R�[�[��D�t�[�L�e�T��)�)�"�+�+�a��+�*F��N��O�O�B�I�I�f�a�0�1����R�Y�Y�x��3�4�
�
�G�G�F�O��������Q���5�
�J�J�x�����0��������Q���5��J�J�x������J�D��������Q���5����*�b�j�j�(�B�L�L�N�S^��_r)c	�v�[SS/SSSS9nURUR5RS55 URURSS9RS	55 URURSS
S9RS55 URURSS
S9RS	55 UR	URSSSSS9S5 [
(a{UR
SS9nURUR[S
5S9RS55 URUR[S
5S9RS	55 UR[[5R5 UR[[5RSS9 UR[URSS9 UR[URSS
S9 UR[URSS9 UR[URSS9 g)ztest genconfig() methodr.r@rFrGr�)r3rMrN�admin__phpass__identz$1$r/z$H$5r�)rr�z$P$5r	�........�)r�salt�rounds�identz"$P$6........22zGEuacuPOqEpYPDeR0R/r?r
�faker�N)rr�r6�
startswithrZrr rrrr�rs�rUr��c2s   r'�test_41_genconfig�"CryptContextTest.test_41_genconfig�s���
�;��"9�(+�12�/2���	
�������1�1�%�8�9�	
������H��5�@�@��H�I�	
������H�w��G�R�R�SY�Z�[�������H�w��G�R�R�SY�Z�[�	
����L�L��u�Q�c�L�J�0�	��3������*�B��O�O�B�L�L�!�G�*�L�=�H�H��P�Q��O�O�B�L�L�!�G�*�L�=�H�H��P�Q�	
���(�L�N�$<�$<�=����(�L�N�$<�$<�[��Q�	
���(�B�L�L���@����)�R�\�\�!�g��N����)�R�\�\�!��<�	
���)�R�\�\�A��>r)c��[S/5nURS5nURH(up4UR"[UR
X240UD6 M* [S/5nURH.upTUcM
UR"[UR
SU40UD6 M0 [S/5nUR[UR
SS5 UR[[5R
SS5 UR[UR
SUSS9 UR[UR
SUS	S9 UR[URSUS	S
9 g)ztest genhash() methodr-�stubNr1rrrCr/r�r
)rr�nonstring_vectorsrrrsr5r�r6)rUr�rr1r$�configs      r'�test_42_genhash� CryptContextTest.test_42_genhash�s0���;�-�
(���w�w�v��� �2�2�L�F����i����V�J�T�J�3��;�-�
(�� �2�2�L�F��|�����i����X�v�N��N�3��:�,�
'�����)�R�Z�Z���>�	
���(�L�N�$:�$:�H�f�M�	
���(�B�J�J��$�v��N����)�R�Z�Z��4���J�	
���)�R�\�\�8�T�A��Nr)c�n�[S0URD6nURS5nURUR"S55 URURSU55 UR
URSU55 UR[URSS9 [S/5nURH(up4UR"[URU40UD6 M* UR[[5RS5 UR[URSSS	9 g
)ztest hash() method�passwordz$5$rounds=3000$�	passwordxi��rLr-r1r�r
NrY)
r�
sample_4_dictrr�rDr3r4rrr�r rKrsr�)rUr�rr1r$s     r'�test_43_hash�CryptContextTest.test_43_hash�s����
/�D�.�.�
/���w�w�z�"��������(9�:�;�����	�	�*�d�3�4�������;��5�6�	
���*�b�g�g�7;�	�	=��;�-�
(�� �2�2�L�F����i����&�A�D�A�3�	
���(�L�N�$7�$7��B�	
���)�R�W�W�h���Cr)c
��[S0URD6nURS/5 URUR	SSSS9S5 SSS5 URS/5 URUR	SSSSS	9S
5 SSS5 URS/5 URUR	SSSS
9S5 SSS5 URS/5 URUR	SSSS
9S5 SSS5 UR[URSSS9 UR[URSSS9 g!,(df   GN=f!,(df   N�=f!,(df   N�=f!,(df   N�=f)z;test hash() method -- legacy 'scheme' and settings keywords�"passing settings to.*is deprecatedrPr@r>)rr@z"$H$5........De04R5Egz0aq8Tf.1eVhY/Nr�)rr@rBz"$P$5........De04R5Egz0aq8Tf.1eVhY/���nacl�rAr@z?$5$rounds=1999$nacl$nmfwJIxqj0csloAAvSER0B8LU0ERCAbhmMug4Twl609��z?$5$rounds=2001$nacl$8PdeoPL4aXQnJ0woHhqgIw/efyfCKC2WHneOpnvF.31r1rCr/r�rY)rrS�assertWarningListrZrrrr�rs)rU�
use_16_legacyr�s   r'�test_43_hash_legacy�$CryptContextTest.test_43_hash_legacy�sk��
�
/�D�.�.�
/�� �
#�
#�%I�$J�
K�������
�8�%��@�4�
�L�
�
#�
#�%I�$J�
K�������
�8�%�s��K�4�
�L��
#�
#�%I�$J�
K�������
�4�f��=�Q�
�L��
#�
#�%I�$J�
K�������
�4�f��=�Q�
�L�	
���(�B�G�G�X�f��E����)�R�W�W�h�q��A�;L�
K��
L�
K��L�
K��L�
K�s/�"E�$#E�!"E+�"E<�
E�
E(�+
E9�<
F
c��/SQn[USS9nURURS5S5 UR[URSSS9 [S/5nUR
H(up4UR"[URU40UD6 M* [5nURURS	5S5 UR[URS	SS9 UR[URSS
S9 g)ztest identify() border cases�r.r-r/r,r-z$9$232323123$1287319827NT)�requiredr-rr�r
)	rrZr2rrr�rKrs�assertIsr�)rUr7r�rr$s     r'�test_44_identify�!CryptContextTest.test_44_identify.s���;��
�(�q�
A��	
������%>�?��F����*�b�k�k�3L�W[��\��;�-�
(���0�0�J�D����i����d�C�d�C�1��^���
�
�b�k�k�&�)�4�0����(�B�K�K��$��G�	
���)�R�[�[�$���Cr)c��/SQn[USS9n[RRS5nURUR	SU55 URUR	SU5(+5 URUR	SUSS95 URUR	SUSS9(+5 UR[URSUSS9 UR[URS	S
5 [S/5nURS	5=p4URH(upVUR
"[URXS40UD6 M* URUR	WS55 [S/5nURH.up6UcM
UR
"[URS
U40UD6 M0 UR[[5RS
S5 UR[URS
USS9 UR[URS
USS9 UR[URS
USS9 g)ztest verify() scheme kwdrar,r-r.r0r.r/r/rJz$6$232323123$1287319827r-Nr1rrCr�r
)rrr.r�r3rrr�rKrsr4r�)rUr7r�r9�refhashr1r$s       r'�test_45_verify�CryptContextTest.test_45_verifyHs���;��
�(�q�
A���N�N����'��	
����	�	�&�!�,�-����B�I�I�h��2�2�3�	
����	�	�&�!�K�	�@�A����B�I�I�h��+�I�F�F�G�	
���*�b�i�i���<��P�	
���*�b�i�i��9R�S��;�-�
(���g�g�f�o�%�� �2�2�L�F����i����F�F��F�3�	
������6�4�0�1��;�-�
(���-�-�G�A��y�����i����H�a�H�4�H�.�	
���(�L�N�$9�$9�8�V�L�	
���(�B�I�I�x����P����)�R�Y�Y��'�!��L�	
���)�R�Y�Y��'�A��Nr)c�^�[S0URD6nURURS55 UR	URS55 URURS55 UR	URS55 UR	URS55 URURS55 /m"U4SjS[
R5n[U/5nURS	5=pEUR	URU55 URTUS
4/5 TS
S
2	UR	URUSS95 URTUS4/5 TS
S
2	URURUS
S95 URTUS
4/5 TS
S
2	[S/5nURH(upFUR"[URU40UD6 M* UR[[5RS5 UR[URUSS9 UR[URUSS9 UR[URUSS9 g
)ztest needs_update() method�
9XXD4trGYeGJAz"$1$J8HC2RCr$HcmM.7NxB2weSvlw2FgzU0zK$5$rounds=1999$jD81UCoo.zI.UETs$Y7qSTQ6mTiU9qZB4fRr43wRgQq4V.5AAf7F97Pzxey/zK$5$rounds=2000$228SSRje04cnNCaQ$YGV4RYu.5sNiBvorQDlO0WWQjyJVGKBcJXz3OtyQ2u8zK$5$rounds=3000$fS9iazEwTKi7QPW4$VasgBC8FqlOvD7x2HhABaMXCTh9jwHclPA9j5YQdns.zK$5$rounds=3001$QlFHHifXvpFX4PLs$/0ekt7lSs/lOikSerQ0M/1porEHxYq7W/2hdFpxA3fAc�>>�\rSrSrSrSr\SU4Sjj5rSrSr	g)	�4CryptContextTest.test_46_needs_update.<locals>.dummyi��dummy�@Nc�2>�TRX45 US:H$)N�nu)�append)�clsrr1�check_states   �r'�needs_update�ACryptContextTest.test_46_needs_update.<locals>.dummy.needs_update�s����"�"�D�>�2���~�%r)c��SSKJn [U[5(aUR	S5n[U"U5R
55$)Nr)�md5re)�hashlibrx�
isinstancerror�	hexdigest)rUr1rxs   r'�_calc_checksum�CCryptContextTest.test_46_needs_update.<locals>.dummy._calc_checksum�s8��'��f�g�.�.�#�]�]�7�3�F�$�S��[�%:�%:�%<�=�=r)rYr)
r�r�r�r�r��_hash_prefix�classmethodrur|r�)rts�r'rnrm�s$����D��L�
�
&��
&�
>r)rnr.N�bob)r1rqr-rrCr/r�r
rY)
rrSr�rur4r�r�rrZrKrrrsr�)rUr�rnrarrgr$rts       @r'�test_46_needs_update�%CryptContextTest.test_46_needs_update{s7���
�
/�D�.�.�
/��	
�������8�9�������)M�N�O�	
������(u�v�w�������)v�w�x�	
������)v�w�x�������(u�v�w�
��
	>�B�$�$�
	>� �E�7�#�����F�+�+������)�)�$�/�0������T�{�m�4���N�	
����)�)�$�u�)�=�>������U�|�n�5���N�	
����(�(��d�(�;�<������T�{�m�4���N��;�-�
(���0�0�J�D����i����$�G�$�G�1�	
���(�L�N�$?�$?��H�	
���(�B�O�O�W�V��L����)�R�_�_�g�a��H�	
���)�R�_�_�g���Jr)c�"�[S0URD6nURS5RS5nURS5RS5nUR	SU5upEURU5 UR
US5 UR	SU5upEURU5 UR
US5 UR	SU5upEURU5 URURU5S5 UR	SU5upEURU5 UR
US5 [S/5nURS5=pgURH(up�UR"[URX�40U	D6 M* URUR	WS5S5 [S/5nURH.upiUcM
UR"[URSU40U	D6 M0 UR[[5RSS	5 UR[URSUS
S9 UR[URSUSS9 UR[URSUSS
9 g)ztest verify_and_update()r-rPrA�	wrongpassNrJ�FNr1rrCr/r�r
rY)rrSr�r�verify_and_updater4rcr�r2rKrrrsrZr�)
rUr��h1�h2�ok�new_hashrrgr1r$s
          r'�test_47_verify_and_update�*CryptContextTest.test_47_verify_and_update�sM��
�
/�D�.�.�
/���Z�Z��
$�
)�
)�*�
5��
�Z�Z��
'�
,�
,�Z�
8���+�+�K��<���������
�
�h��%��+�+�K��<���������
�
�h��%��+�+�J��;��������������H�-�~�>��+�+�J��;���������
�
�h��%��;�-�
(�������(�� �2�2�L�F����i��)=�)=�v�T�t�T�3�	
����-�-�f�d�;�]�K��;�-�
(���0�0�J�D��|�����i��)=�)=�x��V�QU�V�1�	
���(�L�N�$D�$D�h�PV�W�	
���(�B�$8�$8�(�G�TZ��[����)�R�%9�%9�8�W�UV��W�	
���)�R�%9�%9�8�W�WX��Yr)c	��SSKJnJnJn UR	S5nUR	SSS9nUR	SSS9n[X/5nUR
UR[55 URURUR	S55S5 URURSU55 UR
URSU5S5 URS	/5 UR[URSSS9 S
S
S
5 UR[URSUSS9 UR[URSUSS9 [X/5nUR
UR[S/55 URURUR	S55S5 URURSU55 UR
URSU5S5 URURUR	SSS95S5 URURSUSS95 UR
URSUSS9S5 URS	/5 UR[URSSS9 S
S
S
5 UR[URSUSS9 UR[URSUSS9 [X1/S
S9n	UR
U	R[S/55 UR[U	RS5 UR[U	RSU5 UR[U	RSU5 UR
U	R	SSS9U5 URU	RSUSS95 UR
U	RSUSS9S5 UR
U	RSUSS9S5 UR
U	RSUSS9SU45 g
!,(df   GN=f!,(df   GN�=f)zLhash(), verify(), and verify_and_update() -- discard unused context keywordsr)r-r.�postgres_md5rJ�root)r�r�r-)TNrWNr�)�badkwd�autor�r�T)�passlib.hashr-r.r�rrrZ�context_kwds�setr�r2r3r�r\rrrs)
rUr-r.r��des_hash�pg_root_hash�
pg_admin_hashr�r�r�s
          r'�test_48_context_kwds�%CryptContextTest.test_48_context_kwds�s���
	D�C��>�>�&�)��#�(�(��f�(�=��$�)�)�&�w�)�?�
�
�I�1�2������)�)�3�5�1�	
���	�*�*�3�8�8�F�+;�<�k�J�����
�
�6�8�4�5�����.�.�v�x�@�,�O��
#�
#�%I�$J�
K����i����6���G�L����)�S�Z�Z�����O����)�S�%:�%:�F�H�SY��Z�
�I�4�5������)�)�3��x�=�9�	
���	�*�*�3�8�8�F�+;�<�k�J�����
�
�6�8�4�5�����.�.�v�x�@�,�O�	
���	�*�*�3�8�8�F��8�+H�I�;�W�����
�
�6�8�&�
�A�B�����.�.�v�x�f�.�M�|�\��
#�
#�%I�$J�
K����i����6�&��I�L����)�S�Z�Z���&��Q����)�S�%:�%:�F�H�U[��\�
�L�4��H������)�)�3��x�=�9�	
���)�S�X�X�v�6����)�S�Z�Z���F����)�S�%:�%:�F�L�Q�	
������&�v��6��E�����
�
�6�<�f�
�E�F�����.�.�v�|�&�.�Q�S_�`�	
����.�.�v�|�'�.�R�Ta�b�	
����.�.�v�x�f�.�M���-�	/�_L�
K��,L�
K�s�1!P*�!P<�*
P9�<
Qc�6	�[S/SSSS9nSnURSS5nURURS5 URURS5 URUR
S5 UR
[/S-5 URS	SS	S
9nSSS5 URWRSS9S
U-5 UR
/5 URURSSS9SU-5 SSS5 URURSSS9SU-5 URURSSS9SU-5 UR
[/S-5 UR[S5S	-S[S5S	-S9nSSS5 URURSS9SU-5 UR
/5 URURSSS9SU-5 SSS5 URURSSS9SU-5 URURSSS9SU-5 URURSS9SU-5 [RR
nURSUS-S9nURURSS9SXR4-5 URSSS9nURURSS9SU-5 UR[URSS 9 URSS 9 URSS 9 UR[URSS 9 [S/S!9nUR[URSSS"9 UR[[S#S$9 UR[[S#S%9 UR[[S#S&9 UR[[S#S 9 [RR!5nUR["[SUS$9 UR["[SUS%9 UR["[SUS&9 UR["[SUS 9 g!,(df   GN�=f!,(df   GNl=f!,(df   GN�=f!,(df   GN�=f)'ztest rounds limitsrArErDi�	�r3rKrJrLz+...........................................N�i�)rKrJrLrY�r@z$5$rounds=1000$nacl$rXrZz$5$rounds=1999$nacl$z$5$rounds=2000$nacl$r[z$5$rounds=2001$nacl$ge��A)rJrKrLz$5$rounds=999999999$nacl$i�z$5$rounds=3001$nacl$z$5$rounds=3000$nacl$i�z$5$rounds=2999$nacl$z$5$rounds=2500$nacl$r�)rLrJz$5$rounds=%d$nacl$%srRr:)rKrJr�r�)rJr�)r�_get_recordrZ�min_desired_rounds�max_desired_rounds�default_roundsr\rr r6�intrrArrr��datetime�nowrs)rUr��STUB�custom_handlerrF�df�bads       r'�test_50_rounds_limits�&CryptContextTest.test_50_rounds_limitsQsx��
�>�"2�37�37�7;���=�������=������:�:�D�A�����:�:�D�A�����6�6��=��
#�
#�%7�$8��$:�
;����#�PT�9<��>�B�<�	
������6��2�4J�T�4Q�R��
#�
#�B�
'�������D�v��6�8N�QU�8U�
W�(�
	
����L�L��6�L�2�4J�T�4Q�	S�	
����L�L��6�L�2�4J�T�4Q�	S��
#�
#�%7�$8��$:�
;����#�c�(�3�,�Y]�9<�S��#���G�B�<�	
������6��2�4O�RV�4V�W��
#�
#�B�
'�������D�v��6�8N�QU�8U�
W�(�
	
����L�L��6�L�2�4J�T�4Q�	S�	
����L�L��6�L�2�4J�T�4Q�	S�	
������6��2�4J�T�4Q�R��
�
�
-�
-��
�W�W�$�QS�UV�QV�W�
W��������6��2�4J�b�Z�4W�X��W�W�$�QU�W�
V��������6��2�4J�T�4Q�R�
	
���*�b�g�g�D��Q�
���T��2�
���T��2����*�b�g�g�D��Q��>�"2�
3��	
���*�b�g�g��37�	�	9�	
���*�l�S��Q����*�l�S��Q����*�l�S��I����*�l�QT��U����#�#�%�����)�\�>�\_��`����)�\�>�\_��`����)�\�>�TW��X����)�\�>�`c��d�w<�
;��(�
'��"<�
;��(�
'�s0�Q�$Q%�'*Q7�$R	�
Q"�%
Q4�7
R�	
Rc��[S/SSSS9nUR[URSS9 UR[URSS9 UR[URS	S9 URS
S9nUR	URSS5RS
5 URUSSS5 URSS9nUR	URSS5RS
5 URUSSS5 URS
S9nUR	URSS5RS
5 URUSSS5 URSS9nUR	URSS5RS5 URUSSS5 URSS9nUR	URSS5RS5 URUSSS5 URSS9nUR	URSS5RS5 URUSSS5 g)ztest linear vary roundsrAi�i�rEr����r��-1%�101%rN�0%r�rXr[�dz0.1%g����MbP?i�i��100%��?�rrrr�r rZr�r�assert_rounds_rangerEs   r'�test_51_linear_vary_rounds�+CryptContextTest.test_51_linear_vary_rounds�s��
�>�"2�37�37�7;���	
���*�b�g�g���C����*�b�g�g���F����*�b�g�g���G��W�W�a�W�
(����������=�I�I�1�M�� � ��^�T�4�@�
�W�W�d�W�
+����������=�I�I�1�M�� � ��^�T�4�@��W�W�a�W�
(����������=�I�I�1�M�� � ��^�T�4�@�
�W�W�c�W�
*����������=�I�I�3�O�� � ��^�T�4�@��W�W�f�W�
-����������=�I�I�5�Q�� � ��^�T�4�@�
�W�W�f�W�
-����������=�I�I�3�O�� � ��^�T�4�@r)c���[S/SSSS9nUR[URSS9 UR[URSS9 UR[URS	S9 URS
S9nUR	URSS5RS
5 URUSSS5 URSS9nUR	URSS5RS
5 URUSSS5 URS
S9nUR	URSS5RS
5 URUSSS5 URSS9nUR	URSS5RS5 URUSSS5 URSS9nUR	URSS5RS5 URUSSS5 URSS9nUR	URSS5RS5 URUSSS5 URSS9nUR	URSS5RS5 URUSSS5 URSS9nUR	URSS5RS5 URUSSS5 g)ztest log2 vary rounds�bcrypt�rC�)r3�bcrypt__min_rounds�bcrypt__max_rounds�bcrypt__default_roundsr�r�r�r�rNr�r���r�z1%g{�G�z�?z49%g\��(\�?z50%g�?r�r�r�rEs   r'�test_52_log2_vary_rounds�)CryptContextTest.test_52_log2_vary_rounds�s���
�8�*�-/�-/�13���	
���*�b�g�g���C����*�b�g�g���F����*�b�g�g���G��W�W�a�W�
(���������$�7�C�C�Q�G�� � ��X�r�2�6�
�W�W�d�W�
+���������$�7�C�C�Q�G�� � ��X�r�2�6��W�W�a�W�
(���������$�7�C�C�Q�G�� � ��X�r�2�6�
�W�W�c�W�
*���������$�7�C�C�S�I�� � ��X�r�2�6��W�W�d�W�
+���������$�7�C�C�T�J�� � ��X�r�2�6�
�W�W�e�W�
,���������$�7�C�C�T�J�� � ��X�r�2�6�
�W�W�e�W�
,���������$�7�C�C�S�I�� � ��X�r�2�6�
�W�W�f�W�
-���������$�7�C�C�S�I�� � ��X�r�2�6r)c�|�URU5nURSSUR-n[5n[	S5H>nURX&S9n	UR
U	5Rn
URU
5 M@ UR[U5US5 UR[U5US5 g)z2helper to check vary_rounds covers specified rangerr�i,r�z"vary_rounds had wrong lower limit:z"vary_rounds had wrong upper limit:N)r��default_salt_chars�
max_salt_sizer�rr6rlrA�addrZ�min�max)rU�contextr�lower�upperr�r@�seen�ir9�rs           r'r��$CryptContextTest.assert_rounds_ranges����/�/�&�)���)�)�!�A�.��1F�1F�F���u�����A��!�!�&�!�4�A��#�#�A�&�-�-�A��H�H�Q�K��	
����T��E�+O�P�����T��E�+O�Pr)c�z�[R"SS[S9 [S/S9nUR	UR
S5 UR	UR
SS9R
S5 UR	UR
S	S9R
S5 UR	UR
S
S9R
S5 g)zharden_verify -- parsingrPz.*harden_verify.*r
rAr:N�)�
harden_verify�true�false)rSrT�DeprecationWarningrrZr��usingr`s  r'�test_harden_verify_parsing�+CryptContextTest.test_harden_verify_parsing-s�������*=�);�	=��N�#3�4������*�*�D�1���������4�B�B�D�I���������8�F�F��M���������9�G�G��Nr)c���SnSn[R5nXl[U/S9nUR	5 [UR5upVUR
XQX-S9 g)z
dummy_verify() method
rrr:)�deltaN)�	DelayHashr��delayr�dummy_verifyr�assertAlmostEqual)rU�expected�accuracyr�ra�elapsed�_s       r'�test_dummy_verify�"CryptContextTest.test_dummy_verify9s_��
�����/�/�#�� �
��G�9�-�������s�/�/�0�
�����w��8K��Lr)c��SSjn[SSS9nURU"US5/SQ5 URU"US5/SQ5 URSS	9 URU"US5/S
Q5 URU"US5/S
Q5 URSS9 URU"US5/S
Q5 URU"US5/S
Q5 [S/SS9nURU"US5S/5 URU"US5S/5 UR[[SSS9 UR[[SSS9 g)z+test deprecated='auto' is handled correctlyNc�~�UR5Vs/sHo RX!5RPM sn$s snfrr�)rar�rs   r'�getstate�8CryptContextTest.test_61_autodeprecate.<locals>.getstatePs-��KN�;�;�=�Y�=��K�K��1�<�<�=�Y�Y��Ys�$:z sha256_crypt,md5_crypt,des_cryptr�r�)FTTr�r.r?)TFTr-r�)TTFrAFrzauto,md5_cryptzmd5_crypt,autor)rrZr!rrr�)rUr�ras   r'�test_61_autodeprecate�&CryptContextTest.test_61_autodeprecateMsF��	Z��=�&�Q������#�$�/�1D�E�����#�w�/�1D�E�	�
�
�;�
�'�����#�$�/�1D�E�����#�w�/�1D�E�	�
�
�;�
�7�����#�$�/�1D�E�����#�w�/�1D�E��N�+��?������#�$�/�%��9�����#�w�/�%��9�	
���*�l�4L�%5�	�	7����*�l�4L�%5�	�	7r)c�r�SSKJn SSKJnJn [S/5n[SS/5nUR
S5nUR
S5nUR[SUR5 UR[SURU5 UR[SURU5 UR5nURX�R5 URU5n	URX�RU-5 URU5n
URX�RU-5 URURU	5U	5 URURU55 URXRU5 URXRU5 URXRU	5 URURU55 URXRU5 URURU55 URURU	55 URXR S5 UR["UR S	5 URUR!U5U5 URXR U5 URXR U5 URXR U	5 URXR S5 UR["UR S	5 URUR!U5U5 URXR U5 UR[$S
UR U5 URUR!U	5U5 g	)zdisabled hash supportr)�UnknownHashError)r.�
unix_disabledr-r��foozno disabled hasher presentr�Nzcannot restore original hash)�passlib.excr�r�r.r�rr�assertRaisesRegexr{�disablerZ�default_markerr��
is_enabledrrr4�enablersr�)rUr�r.r�rar&�h_ref�h_other�h_dis�	h_dis_ref�h_dis_others           r'�test_disabled_hashes�%CryptContextTest.test_disabled_hashesms���
	1�9��K�=�)���[�/�:�;���������.�.��'��	
���|�-I�"�{�{�	,����|�-I�"�{�{�E�	3����|�-I�"�{�{�G�	5���������� <� <�=��L�L��'�	�����$@�$@�5�$H�I��l�l�7�+������&B�&B�W�&L�M�	
������i�0�)�<�	
������u�-�.����*�N�N�G�D����*�N�N�E�B����*�N�N�I�F�	
�������.�/����*�N�N�G�D��������/�0��������3�4�	
���*�J�J��;����)�S�Z�Z��6�������E�*�E�2����*�J�J��@����*�J�J��>����*�J�J�	�B�	
���*�J�J��;����)�T�[�[�$�7�������U�+�U�3����*�K�K��A����z�+I�#�{�{�E�	3�������Y�/��7r)r�F)Kr�r�r�r��descriptionPrefixr�rr�r�r\r(r]rrnrmrwrxr�r�rzr#rpr}rorqr~rr^r�r�r_r�rSrRrbrtr�r�r�r�r�r�r�r�r�r�r�r�rrrrrr)rKr:rGrMrTr^rdrhr�r�r�r�r�r�r�r�r�r�r�r��
__classcell__)�.0r�rrVs000@r'r+r+1s����&��P��=M�N�=M�T�*�4�0�=M�N���"���!&�%*�#(�#(��M�)��3D�F���
�
���
�
��"�G�G�L�L��}�5�M�)�0�0��4��!�F�)�D���W�W�\�\�$��7�N�'�.�.�q��~�/0���@�@F��x�@P���W�W�\�\�$��7�N�
��!&�!&�%*�!&�
�M���!��
�>�N�
���M�
"�.�-�@�O�
�#�"�%� �!#�%'�"#�#'�#'�'+��!"�
�M�$b�;�6H�<E�6=�:I�)<�V1�0 7�JJB�X"A�HZ2�x#C�J.�(F�,�(<�0"b�HM�^Q�D�B
�r�
�	
��+�&�'�	
�B��	�R��	
��`�6.?�b"O�HD�8/B�bD�41O�fEK�N8Z�tF/�jte�l$A�L-7�^Q�"
O�M�(7�@H8�H8��]1Os�F9r+c�R�\rSrSrSrSr\RrSr	Sr
\"S5rSr
Srg	)
r�i�z-dummy hasher which delays by specified amount�
delay_hash�(rz$x$c���[R"UR5 [U[5(aURS5n[
[R"SU-5R55$)Nresprefix)
�time�sleepr�rzrrorry�sha1r{)rUr1s  r'r|�DelayHash._calc_checksum�sO���
�
�4�:�:���f�g�&�&��]�]�7�+�F��W�\�\�)�f�*<�=�G�G�I�J�Jr)rYN)r�r�r�r��__doc__r�r��LOWER_HEX_CHARS�checksum_chars�
checksum_sizer�rr~r|r�rYr)r'r�r��s.��7��D��'�'�N��M�
�E��U�8�L�Kr)r�c��\rSrSrSrSrg)�dummy_2i�rYNr�rYr)r'rr�s���Dr)rc�*�\rSrSrSrSrSrSrSrg)�LazyCryptContextTesti�r	c�F�[S5 UR[S5 g)Nr)�unload_handler_name�
addCleanup)rUs r'rR�LazyCryptContextTest.setUp�s���I�&����+�Y�7r)c�|�UR[S55 [SS5 [[	SS/5S/S9nUR[SS55 URUR
5S5 URURS5R5 UR[SS55 g)ztest plain kwdsr�passlib.tests.test_contextr-r�T�rr-N)
r4�has_crypt_handlerrr	�iterrZr3r�r�rH)rUr�s  r'�test_kwd_constructor�)LazyCryptContextTest.test_kwd_constructor�s������*�9�5�6�#�I�/K�L�
�d�I�{�#;�<�+��
W�����*�9�d�;�<��������'?�@�����
�
�;�/�:�:�;����)�)�T�:�;r)c�v^�TR[S55 [SS5 SU4Sjjn[USS9nTR[SS55 TR	UR5S5 TR
URS5R5 TR
[SS55 g)	Nrrc�R>�TRU5 [[SS/5S/S9$)Nrr-r�)r�r�r)�flagrUs �r'�onload�>LazyCryptContextTest.test_callable_constructor.<locals>.onload�s(����O�O�D�!���i��%=� >�K�=�Y�Yr)T)rrrr-r�)	r4rrr	rZr3r�r�rH)rUrr�s`  r'�test_callable_constructor�.LazyCryptContextTest.test_callable_constructor�s�������*�9�5�6�#�I�/K�L�	Z��V�$�
7�����*�9�d�;�<��������'?�@�����
�
�;�/�:�:�;����)�)�T�:�;r)rYN)	r�r�r�r�r�rRrrr�rYr)r'rr�s��*��8�
<�<r)r)Ar�
__future__r�passlib.utils.compatr�configparserr�ConfigParserr��	functoolsr�logging�	getLoggerr��logrwrS�passlibr�passlib.contextrr	r�r
r�
passlib.utilsrr
rrrrrr�passlib.utils.handlers�utilsr7r��passlib.tests.utilsrrrrrr�passlib.registryrrrrrrrx�abspath�dirname�__file__r�r(r+ryrr�r�rrrYr)r'�<module>r3s����
&�$��+�+����g�'�'��1��	���:�@�*�M�M�#�#�N�N���
�w�w���r�w�w���x�0�1���D8�x�D8�T4�K�� � �K�"�b����%<�8�%<r)

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 181 B 0644
__main__.cpython-313.pyc File 329 B 0644
_test_bad_register.cpython-313.pyc File 965 B 0644
backports.cpython-313.pyc File 1.57 KB 0644
test_apache.cpython-313.pyc File 39.23 KB 0644
test_apps.cpython-313.pyc File 7 KB 0644
test_context.cpython-313.pyc File 72.82 KB 0644
test_context_deprecated.cpython-313.pyc File 30.41 KB 0644
test_crypto_builtin_md4.cpython-313.pyc File 6.92 KB 0644
test_crypto_des.cpython-313.pyc File 7.09 KB 0644
test_crypto_digest.cpython-313.pyc File 18.36 KB 0644
test_crypto_scrypt.cpython-313.pyc File 26.38 KB 0644
test_ext_django.cpython-313.pyc File 36.14 KB 0644
test_ext_django_source.cpython-313.pyc File 8.11 KB 0644
test_handlers.cpython-313.pyc File 54.12 KB 0644
test_handlers_argon2.cpython-313.pyc File 20.17 KB 0644
test_handlers_bcrypt.cpython-313.pyc File 25.88 KB 0644
test_handlers_cisco.cpython-313.pyc File 10.54 KB 0644
test_handlers_django.cpython-313.pyc File 16.59 KB 0644
test_handlers_pbkdf2.cpython-313.pyc File 18.31 KB 0644
test_handlers_scrypt.cpython-313.pyc File 3.7 KB 0644
test_hosts.cpython-313.pyc File 3.98 KB 0644
test_pwd.cpython-313.pyc File 8.13 KB 0644
test_registry.cpython-313.pyc File 11.15 KB 0644
test_totp.cpython-313.pyc File 61.07 KB 0644
test_utils.cpython-313.pyc File 48.64 KB 0644
test_utils_handlers.cpython-313.pyc File 43.05 KB 0644
test_utils_md4.cpython-313.pyc File 1.59 KB 0644
test_utils_pbkdf2.cpython-313.pyc File 11.64 KB 0644
test_win32.cpython-313.pyc File 2.14 KB 0644
tox_support.cpython-313.pyc File 3.29 KB 0644
utils.cpython-313.pyc File 139.67 KB 0644
Filemanager