Current File : //usr/lib/python2.7/site-packages/passlib/utils/__init__.pyc
�
�;Xc@sbdZddlmZddlmZmZmZddlm	Z	m
Z
ddlZddlm
ZddlmZddlZddlZddlZeje�ZddlZddlZddlZddlZddlZeryddlZWq(ek
rdZdZq(XnddlZddl Z erIddl!Z!nddl"Z"dd	l#m$Z$dd
l%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2ddl3m4Z4m5Z5m6Z6m7Z7m8Z8ddl9m:Z:dd
lm;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZIddddddddddddddddddd d!d"d#d$d%d&gZJeKejeAr�ejLnejMd'�d(�ZNd)d*d+d,d-d.d/gZOd0d1gZPdd2l9mQZQd3ZReBd3�ZSeBd4�ZTeKejUjVd5�pEd6�ZWd7eXfd8��YZYeAr�ejZj[Z\e]e\ejZj^g�Z_d9�Z`n	d:�Z`ddeaddead;�Zbd<�Zcd=�ZdedZeydd>lfmgZdWnek
r�nXd?d@�ZhdAdB�Ziedkr.dAdC�ZindD�ZjeArRdE�ZkdF�Zln(ddGlmmZmmnZndH�ZkdI�Zle;ekdJ�e;eldK�dL�ZodM�ZpdNZqeBdN�ZrddO�ZsdPZtetjudQ�ZvdR�ZwdS�Zxd�ZyeBdT�ZzdV�Z{dWdAddX�Z|dWdAdY�Z}eAr?dWdAdZ�Z~ndWdAd[�Z~e;e~d\�e4d]d^d_d`�dQda��Ze]dbj���Z�e]dcj���Z�e]d3ddg�Z�ddedf�Z�yddgl�m�Z�Wn&ek
r�dZ�eaZ�dh�Z�n4Xe�Z�dNZ�eBdi�Z�eAr(dj�Z�n	dk�Z�e;e�dl�dm�Z�ej�dnkriddol m�Z�nddpl m Z�e�Z�dq�Z�yej�dr�e�Z�Wne�k
r�eaZ�nXdds�Z�e�r�ej��Z�nej�e���Z�dt�Z�du�Z�dvZ�e4d]d`d_dwdxdy�dze�d{��Z�d�Z�d��Z�d�Z�d��Z�d��Z�d��Z�dS(�s4passlib.utils -- helpers for writing password hashesi����(tJYTHON(t
b2a_base64t
a2b_base64tError(t	b64encodet	b64decodeN(tlookup(tupdate_wrappersnot present under Jython(twarn(
tBASE64_CHARSt
AB64_CHARStHASH64_CHARStBCRYPT_CHARStBase64EnginetLazyBase64Engineth64th64bigtbcrypt64tab64_encodetab64_decodetb64s_encodetb64s_decode(tdeprecated_functiontdeprecated_methodtmemoized_propertyt
classpropertyt
hybrid_method(tExpectedStringError(tadd_doct
join_bytestjoin_byte_valuestjoin_byte_elemstirangetimaptPY3tutjoin_unicodetunicodetbyte_elem_valuet
nextgettertunicode_or_bytes_typestget_method_functiontsuppress_causeRtsys_bitstunix_crypt_schemestrounds_cost_valuestconsteqtsaslprept	xor_bytestrender_bytest
is_same_codect
is_ascii_safetto_bytest
to_unicodet
to_native_strt	has_cryptt
test_cryptt
safe_crypttticktrngtgetrandbytest
getrandstrtgenerate_passwordtis_crypt_handlertis_crypt_contextthas_rounds_infot
has_salt_infoig�?tsha512_crypttsha256_cryptt
sha1_crypttbcryptt	md5_cryptt
bsdi_cryptt	des_crypttlineartlog2(tMissingBackendErrortt tPASSLIB_MAX_PASSWORD_SIZEit
SequenceMixincBsMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s�
    helper which lets result object act like a fixed-length sequence.
    subclass just needs to provide :meth:`_as_tuple()`.
    cCstd��dS(Nsimplement in subclass(tNotImplemented(tself((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt	_as_tuple�scCst|j��S(N(treprRS(RR((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt__repr__�scCs|j�|S(N(RS(RRtidx((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt__getitem__�scCst|j��S(N(titerRS(RR((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt__iter__�scCst|j��S(N(tlenRS(RR((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt__len__�scCs|j�|kS(N(RS(RRtother((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt__eq__�scCs|j|�S(N(R](RRR\((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt__ne__�s(
t__name__t
__module__t__doc__RSRURWRYR[R]R^(((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyRP�s						cCsetjt|��j}|s"tS|j|�}|rJ|jtkrJtS|t	|�djt
kS(s*test if function accepts specified keywordi����(tinspectt	signatureR)t
parameterstFalsetgettkindt_VAR_ANY_SETtTruetlistt_VAR_KEYWORD(tfunctkeytparamstarg((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytaccepts_keyword�scCs1tjt|��}||jkp0|jdk	S(s*test if function accepts specified keywordN(Rbt
getargspecR)targstkeywordstNone(RlRmtspec((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyRp�scs�t|t�r|g}nt|j�}|r�t|t�rK|g}nxE|D]:�|rp�|krpqRn�|krR|j��qRqRWn|r�x|D]�t�fd�|D��r�q�n|r&x�t|�D]8\}}	t�|	�r�Pn|r�t|	|�r�Pq�q�Wt|�}nu|r�xltt	|��D]I\}
}	t|	|�r?t|�|
}||d|	ks�t
�Pq?q?Wd}nd}|j|��q�Wn|s�t|�|_ndS(s
    helper to update mixin classes installed in target class.

    :param target:
        target class whose bases will be modified.

    :param add:
        class / classes to install into target's base class list.

    :param remove:
        class / classes to remove from target's base class list.

    :param append:
        by default, prepends mixins to front of list.
        if True, appends to end of list instead.

    :param after:
        optionally make sure all mixins are inserted after
        this class / classes.

    :param before:
        optionally make sure all mixins are inserted before
        this class / classes.

    :param dryrun:
        optionally perform all calculations / raise errors,
        but don't actually modify the class.
    c3s|]}t|��VqdS(N(t
issubclass(t.0tbase(tmixin(s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pys	<genexpr>�siiN(
t
isinstancettypeRjt	__bases__tremovetanyt	enumerateRvRZtreversedtAssertionErrortinsertttuple(ttargettaddR}tappendtbeforetaftertdryruntbasesRVRxtend_idx((Rys:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytupdate_mixin_classes�sB

	ccs�|dkrtd��nt|tj�rqt|�}d}x�||krm||}|||!V|}qBWn�t|tj�r�t|�}xdtr�tj	||�}yt
|�}Wntk
r�PnXtj|f|�Vq�Wnt
d��dS(s8
    split iterable into chunks of <size> elements.
    issize must be positive integerissource must be iterableN(t
ValueErrorRztcollectionstSequenceRZtIterableRXRit	itertoolstislicetnextt
StopIterationtchaint	TypeError(tsourcetsizetendtitntitrt	chunk_itrtfirst((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytbatchs&

	
cCs5t|t�r6t|t�s-td��nt}nBt|t�rlt|t�sctd��nt}ntd��t|�t|�k}|r�|}d}n|s�|}d}n|r�xht||�D]\}}|||AO}q�Wn:x7t||�D]&\}}|t|�t|�AO}qW|dkS(s�Check two strings/bytes for equality.

    This function uses an approach designed to prevent
    timing analysis, making it appropriate for cryptography.
    a and b must both be of the same type: either str (ASCII only),
    or any type that supports the buffer protocol (e.g. bytes).

    Note: If a and b are of different lengths, or if an error occurs,
    a timing attack could theoretically reveal information about the
    types and lengths of a and b--but not their values.
    s)inputs must be both unicode or both bytesii(	RzR%R�RetbytesR"RZtziptord(tlefttrighttis_py3_bytest	same_sizettmptresulttltr((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR./s,				(tcompare_digestt,cCsX|j�}|j|�r(|d }n|s2gSg|j|�D]}|j�^qBS(sRsplit comma-separated string into list of elements,
    stripping whitespace.
    i����(tstriptendswithtsplit(R�tseptelem((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt
splitcommazs
tvaluecs�t|t�s+tdt|�f��ntj�tj�t��fd�|D��}tj	d|�}|sxt
Stj}||d�r�||d�s�td|��ntj
}n|}tj}tj}tj}tj}tj}	tj}
tj}tj}tj}
xv|D]n}�|�s=td���|�sVtd��||�rutd	|��n||�r�td
|��n||�r�td|��n||�r�td|��n|	|�r�td
|��n|
|�rtd|��n||�r/td|��n||�rNtd|��n|
|�rmtd|��n||�rtd|��qqW|S(sNormalizes unicode strings using SASLPrep stringprep profile.

    The SASLPrep profile is defined in :rfc:`4013`.
    It provides a uniform scheme for normalizing unicode usernames
    and passwords before performing byte-value sensitive operations
    such as hashing. Among other things, it normalizes diacritic
    representations, removes non-printing characters, and forbids
    invalid characters such as ``\n``. Properly internationalized
    applications should run user passwords through this function
    before hashing.

    :arg source:
        unicode string to normalize & validate

    :param param:
        Optional noun identifying source parameter in error messages
        (Defaults to the string ``"value"``). This is mainly useful to make the caller's error
        messages make more sense contextually.

    :raises ValueError:
        if any characters forbidden by the SASLPrep profile are encountered.

    :raises TypeError:
        if input is not :class:`!unicode`

    :returns:
        normalized unicode string

    .. note::

        This function is not available under Jython,
        as the Jython stdlib is missing the :mod:`!stringprep` module
        (`Jython issue 1758320 <http://bugs.jython.org/issue1758320>`_).

    .. versionadded:: 1.6
    s$input must be unicode string, not %sc3s3|])}�|�s�|�r'tn|VqdS(N(t_USPACE(Rwtc(tin_table_b1tin_table_c12(s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pys	<genexpr>�stNFKCii����smalformed bidi sequence in s$failed to strip B.1 in mapping stages(failed to replace C.1.2 in mapping stages$unassigned code points forbidden in s control characters forbidden in s$private use characters forbidden in s"non-char code points forbidden in ssurrogate codes forbidden in s!non-plaintext chars forbidden in s!non-canonical chars forbidden in s1display-modifying / deprecated chars forbidden instagged characters forbidden in sforbidden bidi character in (RzR%R�R{t
stringprepR�R�R$tunicodedatat	normalizet_UEMPTYtin_table_d1R�tin_table_d2tin_table_a1tin_table_c21_c22tin_table_c3tin_table_c4tin_table_c5tin_table_c6tin_table_c7tin_table_c8tin_table_c9R�(R�tparamtdatatis_ral_chartis_forbidden_bidi_charR�R�R�R�R�R�R�R�R�R�((R�R�s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR/�sf,		
										

cCstdt��dS(sstub for saslprep()s>saslprep() support requires the 'stringprep' module, which is N(tNotImplementedErrort_stringprep_missing_reason(R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR/scGsHt|t�r!|jd�}n|td�|D��}|jd�S(s&Peform ``%`` formating using bytes in a uniform manner across Python 2/3.

    This function is motivated by the fact that
    :class:`bytes` instances do not support ``%`` or ``{}`` formatting under Python 3.
    This function is an attempt to provide a replacement:
    it converts everything to unicode (decoding bytes instances as ``latin-1``),
    performs the required formatting, then encodes the result to ``latin-1``.

    Calling ``render_bytes(source, *args)`` should function roughly the same as
    ``source % args`` under Python 2.
    slatin-1css3|])}t|t�r'|jd�n|VqdS(slatin-1N(RzR�tdecode(RwRo((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pys	<genexpr>s(RzR�R�R�tencode(R�RrR�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR1s
cCstj|d�S(Ntbig(tintt
from_bytes(R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytbytes_to_int"scCs|j|d�S(NR�(R4(R�tcount((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytint_to_bytes$s(thexlifyt	unhexlifycCstt|�d�S(Ni(R�R�(R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR�)scCstd|d>|�S(Ns%%0%dxi(R�(R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR�+ss/decode byte string as single big-endian integers/encode integer as single big-endian byte stringcCs#tt|�t|�At|��S(s;Perform bitwise-xor of two byte strings (must be same size)(R�R�RZ(R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR01scCsBt|�}||kr6||d|}||| S|| SdS(s;repeat or truncate <source> string, so it has length <size>iN(RZ(R�R�tcurtmult((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt
repeat_string5s
tcCs^t|�}||krR|dkrBt|t�r9tnt}n||||S|| SdS(s>right-pad or truncate <source> string, so it has length <size>N(RZRtRzR%t_UNULLt_BNULL(R�R�tpadR�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytright_pad_stringAst	
 aA:#!tasciicCstj|�tkS(sRTest if codec is compatible with 7-bit ascii (e.g. latin-1, utf-8; but not utf-16)(t_ASCII_TEST_UNICODER�t_ASCII_TEST_BYTES(tcodec((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytis_ascii_codecQscCs<||krtS|o|s tSt|�jt|�jkS(s3Check if two codec names are aliases for same codec(RiRet
_lookup_codectname(R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR2Us
s�ics5t|t�rtnt�t�fd�|D��S(s<Check if string (bytes or unicode) contains only 7-bit asciic3s|]}|�kVqdS(N((RwR�(R�(s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pys	<genexpr>bs(RzR�t_B80t_U80tall(R�((R�s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR3_ssutf-8cCs}|st�t|t�rN|rGt||�rG|j|�j|�S|Sn+t|t�rj|j|�St||��dS(sHelper to normalize input to bytes.

    :arg source:
        Source bytes/unicode to process.

    :arg encoding:
        Target encoding (defaults to ``"utf-8"``).

    :param param:
        Optional name of variable/noun to reference when raising errors

    :param source_encoding:
        If this is specified, and the source is bytes,
        the source will be transcoded from *source_encoding* to *encoding*
        (via unicode).

    :raises TypeError: if source is not unicode or bytes.

    :returns:
        * unicode strings will be encoded using *encoding*, and returned.
        * if *source_encoding* is not specified, byte strings will be
          returned unchanged.
        * if *source_encoding* is specified, byte strings will be transcoded
          to *encoding*.
    N(R�RzR�R2R�R�R%R(R�tencodingR�tsource_encoding((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR4ds
cCsN|st�t|t�r|St|t�r;|j|�St||��dS(s�Helper to normalize input to unicode.

    :arg source:
        source bytes/unicode to process.

    :arg encoding:
        encoding to use when decoding bytes instances.

    :param param:
        optional name of variable/noun to reference when raising errors.

    :raises TypeError: if source is not unicode or bytes.

    :returns:
        * returns unicode strings unchanged.
        * returns bytes strings decoded using *encoding*
    N(R�RzR%R�R�R(R�R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR5�s
cCsBt|t�r|j|�St|t�r/|St||��dS(N(RzR�R�R%R(R�R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR6�s

cCsBt|t�r|St|t�r/|j|�St||��dS(N(RzR�R%R�R(R�R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR6�s

s>Take in unicode or bytes, return native string.

    Python 2: encodes unicode using specified encoding, leaves bytes alone.
    Python 3: leaves unicode alone, decodes bytes using specified encoding.

    :raises TypeError: if source is not unicode or bytes.

    :arg source:
        source unicode or bytes string.

    :arg encoding:
        encoding to use when encoding unicode or decoding bytes.
        this defaults to ``"utf-8"``.

    :param param:
        optional name of variable/noun to reference when raising errors.

    :returns: :class:`str` instance
    t
deprecateds1.6tremoveds1.7cCst||dd�S(s'deprecated, use to_native_str() insteadR�thash(R6(R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytto_hash_str�ss true t yes y on 1 enable enableds#false f no n off 0 disable disabledtnonetbooleancCs�|ttdgkst�t|t�r�|j�j�}|tkrLtS|t	kr\tS|t
krl|Std||f��n-t|t�r�|S|dkr�|St|�SdS(s\
    helper to convert value to boolean.
    recognizes strings such as "true", "false"
    sunrecognized %s value: %rN(
RiReRtR�RzR(tlowerR�t	_true_sett
_false_sett	_none_setR�tbool(R�R�R�tclean((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytas_bool�s(tcryptcCsdS(N(Rt(tsecretR�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR9�ss*:!cCs�t|t�ra|}y|jd�}Wntk
r<dSX|jd�|ksatd��nt|kr|td��nt|t�r�|jd�}nt	||�}|s�|dt
kr�dS|S(Nsutf-8s"utf-8 spec says this can't happen!snull character in secretR�i(RzR�R�tUnicodeDecodeErrorRtR�R�t_NULLR�t_cryptt_invalid_prefixes(R�R�torigR�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR9�s 
cCs�t|t�r!|jd�}nt|kr<td��nt|t�r]|jd�}nt||�}|svdS|jd�}|dtkr�dS|S(Nsutf-8snull character in secretR�i(	RzR%R�R�R�R�RtR�R�(R�R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR9ss�Wrapper around stdlib's crypt.

    This is a wrapper around stdlib's :func:`!crypt.crypt`, which attempts
    to provide uniform behavior across Python 2 and 3.

    :arg secret:
        password, as bytes or unicode (unicode will be encoded as ``utf-8``).

    :arg hash:
        hash or config string, as ascii bytes or unicode.

    :returns:
        resulting hash as ascii unicode; or ``None`` if the password
        couldn't be hashed due to one of the issues:

        * :func:`crypt()` not available on platform.

        * Under Python 3, if *secret* is specified as bytes,
          it must be use ``utf-8`` or it can't be passed
          to :func:`crypt()`.

        * Some OSes will return ``None`` if they don't recognize
          the algorithm being used (though most will simply fall
          back to des-crypt).

        * Some OSes will return an error string if the input config
          is recognized but malformed; current code converts these to ``None``
          as well.
    cCs%|r|st�t||�|kS(s�check if :func:`crypt.crypt` supports specific hash
    :arg secret: password to test
    :arg hash: known hash of password to use as reference
    :returns: True or False
    (R�R9(R�R�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR8Astwin32(tclock(ttimecCsBtjd|�}|r>td�|jd�jd�D��SdS(shelper to parse version strings(\d+(?:\.\d+)+)css|]}t|�VqdS(N(R�(RwR�((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pys	<genexpr>Ysit.N(tretsearchR�tgroupR�Rt(R�tm((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt
parse_versionUs&ic	Cs�ddlm}t|d�rdt|d�rdy|j�}Wqdtk
r`|jd�}qdXntd�|ttd�r�tj�ndt
t��tj�tj
�tr�tjd	�jd
�ndf}t||jd��j�d
�S(s.generate prng seed value from system resourcesi����(tsha512tgetstatetgetrandbitsiis%s %s %s %.15f %.15f %stgetpidi slatin-1isutf-8ii�N(thashlibR
thasattrRR�RR#tosR
RttidtobjectRRthas_urandomturandomR�R�R�t	hexdigest(R�R
ttext((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pytgenseedqs
			(cs)�s
tS��fd�}t|��S(s]return byte-string containing *count* number of randomly generated bytes, using specified rngc3sM�j�d>�}d}x-|�krH|d@V|dL}|d7}qWdS(Niii�i(R(R�R�(R�R;(s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pythelper�s	
(t_BEMPTYR(R;R�R((R�R;s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR<�s	cs��dkrtd��nt����dkrBtd��n�dkrV��S����fd�}t�t�r�t|��St|��SdS(s|return string containing *count* number of chars/bytes, whose elements are drawn from specified charset, using specified rngiscount must be >= 0salphabet must not be emptyic3sT�jd���}d}x1|�krO�|�V|�}|d7}qWdS(Nii(t	randrange(R�R�(tcharsetR�tlettersR;(s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR�s

N(R�RZRzR%R$R(R;RR�R((RR�RR;s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR=�s	
t42346789ABCDEFGHJKMNPQRTUVWXYZabcdefghjkmnpqrstuvwxyzs2.0treplacements/passlib.pwd.genword() / passlib.pwd.genphrase()i
cCstt||�S(swgenerate random password using given length & charset

    :param size:
        size of password.

    :param charset:
        optional string specified set of characters to draw from.

        the default charset contains all normal alphanumeric characters,
        except for the characters ``1IiLl0OoS5``, which were omitted
        due to their visual similarity.

    :returns: :class:`!str` containing randomly generated password.

    .. note::

        Using the default character set, on a OS with :class:`!SystemRandom` support,
        this function should generate passwords with 5.7 bits of entropy per character.
    (R=R;(R�R((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR>�sR�tsetting_kwdstcontext_kwdstverifyR�tidentifycst�fd�tD��S(s4check if object follows the :ref:`password-hash-api`c3s|]}t�|�VqdS(N(R(RwR�(tobj(s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pys	<genexpr>�s(R�t_handler_attrs(R#((R#s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR?�stneeds_updatet	genconfigtgenhashtencryptcst�fd�tD��S(sOcheck if object appears to be a :class:`~passlib.context.CryptContext` instancec3s|]}t�|�VqdS(N(R(RwR�(R#(s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pys	<genexpr>�s(R�t_context_attrs(R#((R#s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyR@�scCs%d|jko$t|dd�dk	S(s_check if handler provides the optional :ref:`rounds information <rounds-attributes>` attributestroundst
min_roundsN(RtgetattrRt(thandler((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyRAscCs%d|jko$t|dd�dk	S(s[check if handler provides the optional :ref:`salt information <salt-attributes>` attributestsaltt
min_salt_sizeN(RR,Rt(R-((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyRBst�(snamessetting_kwdsR R!shashR"(R%R&R'R!R(R"(�Ratpasslib.utils.compatRtbinasciiRRRt_BinAsciiErrortbase64RRR�tcodecsRR�t	functoolsRR�Rbtloggingt	getLoggerR_tlogtmathRtsystrandomRR�tImportErrorRtR�RR�ttypestwarningsRtpasslib.utils.binaryR	R
RRR
RRRRRRRRtpasslib.utils.decorRRRRRtpasslib.excRRRRRR R!R"R#R$R%R&R'R(R)R*t__all__R�tmaxsizetmaxintR+R,R-RLRR�R�tenvironRftMAX_PASSWORD_SIZERRPt	ParametertVAR_KEYWORDRktsettVAR_POSITIONALRhRpReR�R�R.tstr_consteqthmacR�R�R/R1R�R�R�R�R0R�R�R�R�R�R�R�R�R2R�R�R3R4R5R6R�R�R�R�R�R�R�R�R7R9RiR�R�R8tplatformRttimerR:R	RRR�RtSystemRandomR;tRandomR<R=t
_52charsetR>R$R?R)R@RARB(((s:/usr/lib/python2.7/site-packages/passlib/utils/__init__.pyt<module>sJ

X(d	.
		V		>
�				

			
			%

		
	



!