+
    THi                         R t ^ RIt^ RIHtHt ^ RIHt ^ RIHu H	t
 ^ RIHt ^ RIHtHt RR.tRR ltR	t ! R
 R]
P&                  ]
P(                  4      t ! R R]
P,                  ]
P.                  4      tR# )zOracle DB Password HashesN)hexlify	unhexlify)sha1)des_encrypt_block)
to_unicode	xor_bytesoracle10oracle11c                    W\        V4      ) ^,          ,          ,          pTp\        ^ \        V4      ^4       F"  p\        WAWU^,            4      p\        W4      pK$  	  V# )a  performs des-cbc encryption, returns only last block.

this performs a specific DES-CBC encryption implementation
as needed by the Oracle10 hash. it probably won't be useful for
other purposes as-is.

input value is null-padded to multiple of 8 bytes.

:arg key: des key as bytes
:arg value: value to encrypt, as bytes.
:param iv: optional IV
:param pad: optional pad byte

:returns: last block of DES-CBC encryption of all ``value``'s byte blocks.
)lenranger   r   )keyvalueivpadhashoffsetchunks   &&&&   9/usr/lib/python3/dist-packages/passlib/handlers/oracle.pydes_cbc_encryptr      s[      
SZK!O$$ED3u:q)$fz :; , * K    s   #Egc                   Z   a  ] tR t^*t o RtR t]P                  t^t	]
R 4       tR tRtV tR# )r   a  This class implements the password hash used by Oracle up to version 10g, and follows the :ref:`password-hash-api`.

It does a single round of hashing, and relies on the username as the salt.

The :meth:`~passlib.ifc.PasswordHash.hash`, :meth:`~passlib.ifc.PasswordHash.genhash`, and :meth:`~passlib.ifc.PasswordHash.verify` methods all require the
following additional contextual keywords:

:type user: str
:param user: name of oracle user account this password is associated with.
c                "    VP                  4       # )N)upper)clsr   s   &&r   
_norm_hashoracle10._norm_hash:   s    zz|r   c                P   \        V\        4      '       d   VP                  R 4      p\        V P                  R RR7      pW!,           P                  4       P                  R4      p\        \        V4      p\        WC4      p\        V4      P                  R4      P                  4       # )utf-8user)paramz	utf-16-beascii)

isinstancebytesdecoder   r   r   encoder   ORACLE10_MAGICr   )selfsecretr   inputr   s   &&   r   _calc_checksumoracle10._calc_checksum>   s     fe$$]]7+F$))WF;%%'..{;~u5t+t}##G,2244r    N)__name__
__module____qualname____firstlineno____doc__nameuh	HEX_CHARSchecksum_charschecksum_sizeclassmethodr   r*   __static_attributes____classdictcell____classdict__s   @r   r   r   *   s;     	 D\\NM 5 5r   c                      a  ] tR t^St o RtR tRt^(t]P                  t
^;tt]P                  t]P                  ! R]P                   4      t]R 4       tR tR tRtV tR# )	r	   a  This class implements the Oracle11g password hash, and follows the :ref:`password-hash-api`.

It supports a fixed-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 20 hexadecimal characters.

: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/^S:(?P<chk>[0-9a-f]{40})(?P<salt>[0-9a-f]{20})$c                    \        VR R4      pV P                  P                  V4      pV'       g    \        P                  P                  V 4      hVP                  RR4      w  r4V ! W4P                  4       R7      # )r!   r   saltchk)r>   checksum)r   _hash_regexmatchr3   excInvalidHashErrorgroupr   )r   r   mr>   r?   s   &&   r   from_stringoracle11.from_stringx   s_    $0OO!!$'&&))#..GGFE*	yy{33r   c                t    V P                   pR VP                  4        V P                  P                  4        2# )zS:)r@   r   r>   )r'   r?   s   & r   	to_stringoracle11.to_string   s.    mmCIIK=!2 344r   c                    \        V\        4      '       d   VP                  R 4      p\        V\	        V P
                  P                  R4      4      ,           4      P                  4       pVP                  4       # )r   r!   )r"   strr%   r   r   r>   	hexdigestr   )r'   r(   r?   s   && r   r*   oracle11._calc_checksum   sU    fc""]]7+F6Idii&6&6w&?@@AKKMyy{r   r,   N)r>   )r-   r.   r/   r0   r1   r2   setting_kwdsr6   r3   UPPER_HEX_CHARSr5   min_salt_sizemax_salt_size
salt_charsrecompile
IGNORECASErA   r7   rG   rJ   r*   r8   r9   r:   s   @r   r	   r	   S   sw     0 DLM''N %'&MM##J**92==K 4 45 r   )s               )r1   rU   binasciir   r   hashlibr   passlib.utils.handlersutilshandlersr3   passlib.crypto.desr   passlib.utilsr   r   __all__r   r&   HasUserContextStaticHandlerr   HasSaltGenericHandlerr	   r,   r   r   <module>re      sf     	 '  # # 0 /z
"2 5&5r  ""2"2 &5R6rzz2,, 6r   