o Ehs@sJddlZddlZddlZzddlZWn eydZYnwdddZdS)NTcsfddS)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 cs|ttr.jd}|dur fdd}jd|_j|_n|j}t|}|_St fdd}|S)N setUpClasscst|dS)N)superr)cls func_or_class2/usr/lib/python3.10/test/support/hashlib_helper.pyrsz:requires_hashdigest..decorator..setUpClassz .setUpClasscs^zrtdurtjdntjdWnty'tddw|i|S)N)usedforsecurityz hash digest 'z' is not available.)_hashlibnewhashlib ValueErrorunittestSkipTest)argskwargs) digestnameropensslr rrwrapper&s   z7requires_hashdigest..decorator..wrapper) isinstancetype__dict__get __qualname__ __module____func__ classmethodr functoolswraps)rrr decoratorrrr rrr s       z&requires_hashdigest..decoratorr)rrr rrrrequires_hashdigest s r!)NT)rr rr ImportErrorr!rrrrs