HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib64/python3.6/site-packages/M2Crypto/__pycache__/AuthCookie.cpython-36.pyc
3

���[N�@s�ddlmZddlZddlZddlZddlmZmZmZm	Z	m
Z
ddlmZerlddl
mZmZmZmZmZdZejd�Zeje�Zefdd	�Zefd
d�Zefdd
�ZdZGdd�de�ZGdd�de�ZdS)�)�absolute_importN)�Rand�m2�py27plus�six�util)�SimpleCookie)�re�AnyStr�Dict�Optional�Unionzexp=%f&data=%s&digest=z%exp=(\d+\.\d+)&data=(.+)&digest=(\S*)cCs|||fS)N�)�expiry�data�formatrr�"/usr/lib64/python3.6/AuthCookie.py�mixsrcCs.|j|�}|r&t|jd��|jd�fSdSdS)N��)�match�float�group)�dough�regex�morrr�unmixs
rcCs6|j|�}|r.t|jd��|jd�|jd�fSdSdS)Nrr�)rrr)rrrrrr�unmix3%s
 rZ_M2AUTH_c@s:eZdZdZdd�Zdd�Zdd�Zdd	�Zddd�Zd
S)�
AuthCookieJar�cCstj|j�|_dS)N)rZ
rand_bytes�_keylen�_key)�selfrrr�__init__5szAuthCookieJar.__init__cCstjtj|tj|�tj���S)N)rZ
bin_to_hexrZhmacrZ
ensure_binaryZsha1)r#�keyrrrr�_hmac9szAuthCookieJar._hmaccCs>t|tjtf�std|��t||�}t||||j|j|��S)z�
        Make a cookie

        :param expiry: expiration time (float in seconds)
        :param data: cookie content
        :return: AuthCookie object
        z'Expiration time must be number, not "%s)	�
isinstancer�
integer_typesr�
ValueErrorr�
AuthCookier&r")r#rrrrrr�
makeCookie=s	
zAuthCookieJar.makeCookiecCs^t|t�st�|j�rdS|j|j|j�}|j|jko\|j|jko\|j|jko\|j�|j�kS)Nr)	r'r*�AssertionError�	isExpiredr+�_expiry�_data�_mac�output)r#Zcookie�crrr�isGoodCookieKszAuthCookieJar.isGoodCookieFc	Cs�t�}|j|�t|kr,tjdt|��dSt|tj�}|dkrPtjd�dS|\}}}|j||�}|r�|j	|kr�tj
d|�tj
d|j��tj
d|�tj
d|j	�tj
dt|j	|k��|j�o�|j	|kS)	Nz_TOKEN not in c (keys = %s)rzundough is Nonezcookie_str = %szc2.isExpired = %szmac = %szc2._mac = %szc2._mac == mac: %s)
r�load�_TOKEN�log�debug�dirr�valuer+r0�errorr-�str)	r#Z
cookie_strZ_debugr2ZundoughZexpr�macZc2rrr�isGoodCookieStringVs$


z AuthCookieJar.isGoodCookieStringN)F)	�__name__�
__module__�__qualname__r!r$r&r+r3r=rrrrr1src@sVeZdZdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)r*cCs>||_||_||_t�|_d||f|jt<d||f|_dS)a4
        Create new authentication cookie

        :param expiry: expiration time (in seconds)
        :param data: cookie payload (as a string)
        :param dough: expiry & data concatenated to URL compliant
                      string
        :param mac: SHA1-based HMAC of dough and random key
        z%s%sN)r.r/r0r�_cookier5�_name)r#rrrr<rrrr$nszAuthCookie.__init__cCs|jS)z Return the cookie's expiry time.)r.)r#rrrr�szAuthCookie.expirycCs|jS)z&Return the data portion of the cookie.)r/)r#rrrr�szAuthCookie.datacCs|jS)zReturn the cookie's MAC.)r0)r#rrrr<�szAuthCookie.mac�Set-Cookie:cCs|jj|d�S)z2Return the cookie's output in "Set-Cookie" format.)�header)rAr1)r#rDrrrr1�szAuthCookie.outputcCs|jtjS)zEReturn the cookie's output minus the "Set-Cookie: " portion.
        )rAr5r9)r#rrrr9�szAuthCookie.valuecCs t|jttjf�otj�|jkS)z0Return 1 if the cookie has expired, 0 otherwise.)r'r.rrr(�time)r#rrrr-�szAuthCookie.isExpiredcCs|jS)N)rB)r#rrr�name�szAuthCookie.namecCs|j�S)N)r9)r#rrr�headerValue�szAuthCookie.headerValueN)rC)r>r?r@r$rrr<r1r9r-rFrGrrrrr*ls
	r*) Z
__future__rZloggingr	rEZM2CryptorrrrrZM2Crypto.six.moves.http_cookiesrZtypingZtype_rer
rrr
Z_MIX_FORMAT�compileZ_MIX_REZ	getLoggerr>r6rrrr5�objectrr*rrrr�<module>s 

		;