Server IP : 111.118.215.189 / Your IP : 3.149.29.120 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /lib64/python3.6/__pycache__/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
3 �i�g��@s�ddlZddlmZddlZddlZddlZe dd�e d�D��Ze dd�e d�D��ZdZ Gdd�d�Zd d �ZGdd�dej�Zej�r�eZdd d�ZdS)�N)�_compare_digestccs|]}|dAVqdS)�\N�)�.0�xrr�/usr/lib64/python3.6/hmac.py� <genexpr>sr�ccs|]}|dAVqdS)�6Nr)rrrrrr sc@sNeZdZdZddd�Zedd��Zdd�Zd d �Zdd�Z d d�Z dd�ZdS)�HMAC�@Ncsftj�rtd��t|ttf�s0tdt|�j���dkrLt j dtd�tj �t��r\�|_n,t�t�rxd�fdd� |_nd�fd d� |_|j�|_|j�|_|jj|_t|jd �r�|jj}|dkr�t j d||jftd�|j}nt j d |jtd�|j}||_t|�|k�r|j|�j�}|j|d�}|jj|jt��|jj|jt��|dk �rb|j|�dS)Nz*This class is not available in FIPS mode. zUse hmac.new().z,key: expected bytes or bytearray, but got %rz<HMAC() without an explicit digestmod argument is deprecated.��cstj�|�S)N)�_hashlib�new)�d)� digestmodrr�<lambda>;szHMAC.__init__.<locals>.<lambda>cs �j|�S)N)r)r)rrrr=s� block_size�z:block_size of %d seems too small; using our default of %d.z<No block_size attribute on given digest object; Assuming %d.�z9This class is not available in FIPS mode. Use hmac.new().)r)r)�_hashlibopenssl� get_fips_mode� ValueError� isinstance�bytes� bytearray� TypeError�type�__name__� _warnings�warn�PendingDeprecationWarningrZmd5�callable�digest_cons�str�outer�inner�digest_size�hasattrr� blocksize�RuntimeWarning�len�digest�ljust�update� translate�trans_5C�trans_36)�self�key�msgrr*r)rr�__init__sJ z HMAC.__init__cCsd|jjS)Nzhmac-)r'�name)r3rrrr7]sz HMAC.namecCs tj�rtd��|jj|�dS)Nz'hmac.HMAC is not available in FIPS mode)rrrr'r/)r3r5rrrr/aszHMAC.updatecCs:|jj|j�}|j|_|j|_|jj�|_|jj�|_|S)N)� __class__�__new__r$r(r'�copyr&)r3�otherrrrr:hsz HMAC.copycCs|jj�}|j|jj��|S)N)r&r:r/r'r-)r3�hrrr�_currentus z HMAC._currentcCs|j�}|j�S)N)r=r-)r3r<rrrr-~szHMAC.digestcCs|j�}|j�S)N)r=� hexdigest)r3r<rrrr>�szHMAC.hexdigest)NN)r� __module__�__qualname__r*r6�propertyr7r/r:r=r-r>rrrrrs A rcCsX|dkrtd��t|t�r"|j�St|�r2|d�}t|tj�sFtd��|jj�j dd�S)Nz.'digestmod' argument is mandatory in FIPS moderz6Only OpenSSL hashlib hashes are accepted in FIPS mode.�_�-) rrr%�lowerr#rZHASHrr7�replace)rrrr�_get_openssl_name�s rFc@seZdZddd�ZdS)�HMAC_opensslNcCsLt|ttf�s tdt|�j��t|�}tjj |||d�}|rH|j |�|S)Nz,key: expected bytes or bytearray, but got %r)r)rrrrrrrF�_hmacopensslrr9r/)�clsr4r5rr7�resultrrrr9�s zHMAC_openssl.__new__)NN)rr?r@r9rrrrrG�srGcCst|||�S)N)r)r4r5rrrrr�sr)NN)�warningsr � _operatorrZcompare_digestZhashlibrrrHr�ranger1r2r(rrFrGrrrrrr�<module>sz