hsLddlZddlZddlZ ddlZn #e$rdZYnwxYwddZdS)NTcfdS)aDecorator 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 cBttrejd}|!fd}jdz|_j|_n|j}t|}|_Stj fd}|S)N setUpClasscLt|dS)N)superr)cls func_or_classs 2/usr/lib/python3.11/test/support/hashlib_helper.pyrz:requires_hashdigest..decorator..setUpClasss%---88:::::z .setUpClassc rttjntjn&#t$rt jddwxYw|i|S)N)usedforsecurityz hash digest 'z' is not available.)_hashlibnewhashlib ValueErrorunittestSkipTest)argskwargs digestnamer opensslr s r wrapperz7requires_hashdigest..decorator..wrapper&s Mx3L_MMMMMK OLLLL   'CJCCC !=$1&11 1s 6:#A) isinstancetype__dict__get __qualname__ __module____func__ classmethodr functoolswraps)r rr decoratorrrr s` r r#z&requires_hashdigest..decorators mT * * !&/33LAAJ!;;;;;*7*D}*T '(5(@ %%'0 $YYz%:%:;;J'1M $  ' ' 2 2 2 2 2 2 2 ( ' 2r )rrr r#s```@r requires_hashdigestr% s66 r )NT)r!rrr ImportErrorr%r$r r r'suOOOOHHH((((((s