
    dafs                     H    d dl Z d dlZd dlZ	 d dlZddZy# e$ r dZY w xY w)    Nc                       fdS )a  Decorator raising SkipTest if a hashing algorithm is not available

    The hashing algorithm could be missing or blocked by a strict crypto
    policy.

    If 'openssl' is True, then the decorator checks that OpenSSL provides
    the algorithm. Otherwise the check falls back to built-in
    implementations. The usedforsecurity flag is passed to the constructor.

    ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS
    ValueError: unsupported hash type md4
    c                 F    t         t              rn j                  j                  d      }|+ fd} j                  dz   |_         j
                  |_        n|j                  }t         |            }| _         S t        j                          fd       }|S )N
setUpClassc                 "    t         |           y )N)superr   )clsfunc_or_classs    6/root/Python-3.12.4/Lib/test/support/hashlib_helper.pyr   z:requires_hashdigest.<locals>.decorator.<locals>.setUpClass   s    -8:    z.setUpClassc                      	 rt         t        j                         nt        j                          | i |S # t        $ r t	        j
                  d d      w xY w)N)usedforsecurityzhash digest 'z' is not available.)_hashlibnewhashlib
ValueErrorunittestSkipTest)argskwargs
digestnamer	   opensslr   s     r
   wrapperz7requires_hashdigest.<locals>.decorator.<locals>.wrapper&   so    x3LL_MKK
OL
 !$1&11	  ''#J</BC s   7A #A%)
isinstancetype__dict__get__qualname__
__module____func__classmethodr   	functoolswraps)r	   r   r   	decoratorr   r   r   s   `  r
   r#   z&requires_hashdigest.<locals>.decorator   s    mT*&//33LAJ!;*7*D*D}*T
'(5(@(@
%'00
$Yz%:;J'1M$  		'
	2 
(
	2 r    )r   r   r   r#   s   ```@r
   requires_hashdigestr%      s    6 r   )NT)r!   r   r   r   ImportErrorr%   r$   r   r
   <module>r'      s1      
(	  Hs    !!