+
    ¢THi*&  ã                   óè   € R t ^ RIHt ^ RIHu Ht ^ RIHt ^ RI	H
t
 RR.tRtRtR	tRtRtRR
 lt ! R R]P$                  ]P&                  4      t ! R R]P*                  ]4      t ! R R]4      tR# )zmd5-crypt algorithm)Úmd5N)Úrepeat_string)Úh64Ú	md5_cryptÚapr_md5_cryptó    s   $1$s   $apr1$c                ó\  € \        V \        4      '       d   V P                  R4      p \        V \        4      '       g   Q R4       h\        V 9   d$   \
        P                  P                  \        4      h\        V 4      p\        V\        4      '       g   Q R4       hVP                  R4      p\        V4      ^	8  g   Q R4       hV'       d   \        pM\        p\        W,           V ,           4      P                  4       p\        W,           V,           4      pVP                  pV! \        WS4      4       TpV R,          p	V'       d)   T! V^,          '       d   \        MT	4       V^,          pK0  VP                  4       p
W ,           pW,           pWWÌV ,           W,           W,           .p\          UUu. uF  w  rïWÞ,          Wß,          3NK  	  pppT
p^pV'       dU   V FC  w  rï\        V\        VV,           4      P                  4       ,           4      P                  4       pKE  	  V^,          pK\  VR,           FC  w  rï\        V\        VV,           4      P                  4       ,           4      P                  4       pKE  	  \"        P$                  ! V\&        4      P)                  R4      # u uppi )ab  perform raw md5-crypt calculation

this function provides a pure-python implementation of the internals
for the MD5-Crypt algorithms; it doesn't handle any of the
parsing/validation of the hash strings themselves.

:arg pwd: password chars/bytes to hash
:arg salt: salt chars to use
:arg use_apr: use apache variant

:returns:
    encoded checksum chars
zutf-8zpwd not str or byteszsalt not strÚasciizsalt too large:Né   N:Né   N)Ú
isinstanceÚstrÚencodeÚbytesÚ_BNULLÚuhÚexcÚNullPasswordErrorr   ÚlenÚ
_APR_MAGICÚ
_MD5_MAGICr   ÚdigestÚupdater   Ú_c_digest_offsetsr   Úencode_transposed_bytesÚ_transpose_mapÚdecode)ÚpwdÚsaltÚuse_aprÚpwd_lenÚmagicÚdbÚa_ctxÚa_ctx_updateÚiÚevencharÚdaÚpwd_pwdÚpwd_saltÚpermsÚevenÚoddÚdataÚdcÚblockss   &&&                Ú</usr/lib/python3/dist-packages/passlib/handlers/md5_crypt.pyÚ_raw_md5_cryptr1   7   s!  € ô, �#”s×ÒØ�j‰j˜Ó!ˆÜ�cœ5×!Ò!Ð9Ð#9Ó9Ð!Ü�„}Ü�f‰f×&Ñ&¤yÓ1Ð1Ü�#‹h€Gô �dœC× Ò Ð0 .Ó0Ð Ø�;‰;�wÓ€DÜˆt‹9�qŒ=Ð*Ð*Ó*ˆ=÷ Ü‰äˆÜ	ˆS�Z˜#ÕÓ	×	%Ñ	%Ó	'€Bä�•˜dÕ"Ó#€EØ—<‘<€Lñ ”˜rÓ+Ô,ð 	€AØ�2�w€Hß
Ù˜q 1Ÿuœu•V¨(Ô3Ø	ˆa�Šð 
�‰‹€Bð\ �i€GØ�z€HØ˜8°¥^°TµZÀÅÐP€Eõ 8IÔIÑ7H©)¨$ˆU�[˜%�*Ó%Ñ7H€DÑIð 
€BØ€Fß
Û‰IˆDÜ�Sœ3˜r D�y›>×0Ñ0Ó2Õ2Ó3×:Ñ:Ó<ŠBñ à�!�Šð ˜#—Y�Y‰	ˆÜ�”s˜2 �9“~×,Ñ,Ó.Õ.Ó/×6Ñ6Ó8Šñ ä×&Ò& r¬>Ó:×AÑAÀ'ÓJÐJùó Js   Æ0J(c                   óv   a € ] tR t^¹t o RtRt^t]P                  t	^t
]P                  t]R 4       tR tRtV tR# )Ú_MD5_Commonz+common code for md5_crypt and apr_md5_cryptc                ó\   € \         P                  ! WP                  V R 7      w  r#V ! W#R7      # ))Úhandler)r   Úchecksum)r   Ú	parse_mc2Úident)ÚclsÚhashr   Úchks   &&  r0   Úfrom_stringÚ_MD5_Common.from_stringÅ   s#   € ä—L’L §y¡y¸#Ô>‰	ˆÙ˜Ô+Ð+ó    c                ón   € \         P                  ! V P                  V P                  V P                  4      # ©N)r   Ú
render_mc2r8   r   r6   )Úselfs   &r0   Ú	to_stringÚ_MD5_Common.to_stringÊ   s!   € Ü�}Š}˜TŸZ™Z¨¯©°D·M±MÓBÐBr>   © N)r   Ú	salt_size)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úsetting_kwdsÚchecksum_sizer   ÚHASH64_CHARSÚchecksum_charsÚmax_salt_sizeÚ
salt_charsÚclassmethodr<   rC   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r0   r3   r3   ¹   sI   ø‡ € Ù5ð )€Là€MØ—_‘_€Nà€MØ—‘€Jàñ,ó ð,÷Cð Cr>   r3   c                   óF   a € ] tR t^Ðt o RtR tRtRt]R 4       t	R t
RtV tR# )r   a=  This class implements the MD5-Crypt password hash, and follows the :ref:`password-hash-api`.

It supports a variable-length salt.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

:type salt: str
:param salt:
    Optional salt string.
    If not specified, one will be autogenerated (this is recommended).
    If specified, it must be 0-8 characters, drawn from the regexp range ``[./0-9A-Za-z]``.

:type salt_size: int
:param salt_size:
    Optional number of characters to use when autogenerating new salts.
    Defaults to 8, but can be any value between 0 and 8.
    (This is mainly needed when generating Cisco-compatible hashes,
    which require ``salt_size=4``).

:type relaxed: bool
:param relaxed:
    By default, providing an invalid value for one of the other
    keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
    and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
    will be issued instead. Correctable errors include
    ``salt`` strings that are too long.

    .. versionadded:: 1.6
z$1$c                ó<   € V P                  V P                  4       R # )T)Ú_set_calc_checksum_backendÚ_calc_checksum_builtin)r9   s   &r0   Ú_load_backend_builtinÚmd5_crypt._load_backend_builtinù   s   € à×&Ñ& s×'AÑ'AÔBÙr>   c                ó,   € \        WP                  4      # r@   ©r1   r   ©rB   Úsecrets   &&r0   rZ   Ú md5_crypt._calc_checksum_builtinþ   s   € Ü˜f§i¡iÓ0Ð0r>   rE   N)Úbuiltin)rG   rH   rI   rJ   rK   Únamer8   ÚbackendsrR   r[   rZ   rS   rT   rU   s   @r0   r   r   Ð   s;   ø‡ € ñð< €DØ€Eð €Hð
 ñó ð÷1ð 1r>   c                   ó2   a € ] tR tRt o RtR tRtR tRtV t	R# )r   i  a0  This class implements the Apr-MD5-Crypt password hash, and follows the :ref:`password-hash-api`.

It supports a variable-length salt.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

:type salt: str
:param salt:
    Optional salt string.
    If not specified, one will be autogenerated (this is recommended).
    If specified, it must be 0-8 characters, drawn from the regexp range ``[./0-9A-Za-z]``.

:type relaxed: bool
:param relaxed:
    By default, providing an invalid value for one of the other
    keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
    and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
    will be issued instead. Correctable errors include
    ``salt`` strings that are too long.

    .. versionadded:: 1.6
z$apr1$c                ó0   € \        WP                  R R7      # )T)r   r^   r_   s   &&r0   Ú_calc_checksumÚapr_md5_crypt._calc_checksum  s   € Ü˜f§i¡i¸Ô>Ð>r>   rE   N)
rG   rH   rI   rJ   rK   rc   r8   rg   rS   rT   rU   s   @r0   r   r     s    ø‡ € ñð. €DØ€E÷?ð ?r>   ))é    é   ©é   r
   ©rl   rj   )r
   é   rk   rm   ©r
   rj   )é   r
   rm   ro   )rl   ri   rm   ro   rk   )rp   rj   ro   rk   )rl   rn   ro   rk   rm   )é   é   ri   é   é   r
   é   é   rn   é   é	   rj   rl   é
   rp   é   )F)rK   Úhashlibr   Úpasslib.utils.handlersÚutilsÚhandlersr   Úpasslib.utilsr   Úpasslib.utils.binaryr   Ú__all__r   r   r   r   r   r1   ÚHasSaltÚGenericHandlerr3   ÚHasManyBackendsr   r   rE   r>   r0   Ú<module>r…      sŠ   ðÙ å ç #Ð #Ý 'Ý $ð Øð€ð 
€Ø€
Ø€
ðÐ ð2 H€ôKôDC�"—*‘*˜b×/Ñ/ô Cô./1�×"Ñ" Kô /1ôd?�Kö ?r>   