ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python3.8/__pycache__/hmac.cpython-38.pyc
U

&.e@sdZddlZddlmZzddlZWnek
r@dZdZ	YnXe
ejZ	ddlZddlZ
ddlZeddedDZeddedDZdZGdd	d	Zd
dZGdd
d
ejZe
reZdddZddZdS)zqHMAC (Keyed-Hashing for Message Authentication) module.

Implements the HMAC algorithm as described by RFC 2104.
N)_compare_digestccs|]}|dAVqdS)\N.0xrr/usr/lib64/python3.8/hmac.py	<genexpr>sr	ccs|]}|dAVqdS)6Nrrrrrr	sc@sReZdZdZdZdddZeddZd	d
ZddZ	d
dZ
ddZddZdS)HMACz~RFC 2104 HMAC class.  Also complies with RFC 4231.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    @NcsVtrtdt|ttfs0tdt|js<tdt	rL|_
n,ttrhdfdd	|_
ndfdd	|_
|
|_|
|_
|j
j|_t|j
dr|j
j}|d	krtd
||jftd|j}ntd|jtd|j}||_t||kr|
|}||d
}|j|t|j
|t|dk	rR||dS)a?Create a new HMAC object.

        key: bytes or buffer, key for the keyed hash object.
        msg: bytes or buffer, Initial input for the hash or None.
        digestmod: A hash name suitable for hashlib.new(). *OR*
                   A hashlib constructor returning a new hash object. *OR*
                   A module supporting PEP 247.

                   Required as of 3.8, despite its position after the optional
                   msg argument.  Passing it as a keyword argument is
                   recommended, though not required for legacy API reasons.
        z9This class is not available in FIPS mode. Use hmac.new().,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.cst|SN_hashlibnewd	digestmodrr<lambda>?rzHMAC.__init__.<locals>.<lambda>cs
|SrrrrrrrAr
block_sizez:block_size of %d seems too small; using our default of %d.z<No block_size attribute on given digest object; Assuming %d.N)r)r)_hashlibopenssl
get_fips_mode
ValueError
isinstancebytes	bytearray	TypeErrortype__name__callabledigest_consstrouterinnerdigest_sizehasattrr	_warningswarn	blocksizeRuntimeWarninglendigestljustupdate	translatetrans_5Ctrans_36)selfkeymsgrr1rrr__init__#sR





z
HMAC.__init__cCsd|jjS)Nzhmac-)r,name)r:rrrr>asz	HMAC.namecCs trtd|j|dS)z,Feed data from msg into this hashing object.z'hmac.HMAC is not available in FIPS modeN)rr r!r,r6)r:r<rrrr6eszHMAC.updatecCs:|j|j}|j|_|j|_|j|_|j|_|S)zyReturn a separate copy of this hashing object.

        An update to this copy won't affect the original object.
        )	__class____new__r)r-r,copyr+)r:otherrrrrAksz	HMAC.copycCs|j}||j|S)zwReturn a hash object for the current state.

        To be used only internally with digest() and hexdigest().
        )r+rAr6r,r4r:hrrr_currentxs
z
HMAC._currentcCs|}|S)zReturn the hash value of this hashing object.

        This returns the hmac value as bytes.  The object is
        not altered in any way by this function; you can continue
        updating the object after calling this function.
        )rEr4rCrrrr4szHMAC.digestcCs|}|S)zKLike digest(), but returns a string of hexadecimal digits instead.
        )rE	hexdigestrCrrrrFszHMAC.hexdigest)Nr)
r'
__module____qualname____doc__r1r=propertyr>r6rArEr4rFrrrrrs
>

	
rcCsHt|tr|St|r"|d}t|tjs6td|jddS)Nrz6Only OpenSSL hashlib hashes are accepted in FIPS mode._-)	r"r*lowerr(rZHASHr%r>replacerrrr_get_openssl_names
rOc@seZdZdddZdS)HMAC_opensslNcCsLt|ttfs tdt|jt|}tjj	|||d}|rH|
||S)Nrr)r"r#r$r%r&r'rO_hmacopensslrr@r6)clsr;r<rr>resultrrrr@s
zHMAC_openssl.__new__)NN)r'rGrHr@rrrrrPsrPrcCst|||S)aCreate a new hashing object and return it.

    key: bytes or buffer, The starting key for the hash.
    msg: bytes or buffer, Initial input for the hash, or None.
    digestmod: A hash name suitable for hashlib.new(). *OR*
               A hashlib constructor returning a new hash object. *OR*
               A module supporting PEP 247.

               Required as of 3.8, despite its position after the optional
               msg argument.  Passing it as a keyword argument is
               recommended, though not required for legacy API reasons.

    You can now feed arbitrary bytes into the object using its update()
    method, and can ask for the hash value at any time by calling its digest()
    or hexdigest() methods.
    )r)r;r<rrrrrsrcstdk	r(ttr(tkr(t||Str6}n(ttrPd	fdd	}nd
fdd	}|}|}t|dd}t||kr||}|d|t|}|	|
t|	|
t|	||	||S)aJFast inline implementation of HMAC.

    key: bytes or buffer, The key for the keyed hash object.
    msg: bytes or buffer, Input message.
    digest: A hash name suitable for hashlib.new() for best performance. *OR*
            A hashlib constructor returning a new hash object. *OR*
            A module supporting PEP 247.
    Nrcst|Srrrr4rrrrzdigest.<locals>.<lambda>cs
|SrrrrTrrrrrr
r)r)r)
_hashopensslr"r*_openssl_md_methsZhmac_digestr(getattrr3r4r6r7r9r8)r;r<r4r)r,r+r1rrTrr4s,	

r4)Nr)rIwarningsr/	_operatorrZcompare_digestrrUImportErrorrV	frozensetZopenssl_md_meth_namesZhashlibrrQr#ranger8r9r-rrOrPr rr4rrrr<module>s*

u