MCPcopy Index your code
hub / github.com/RustPython/RustPython / __get_openssl_constructor

Function __get_openssl_constructor

Lib/hashlib.py:126–141  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

124
125
126def __get_openssl_constructor(name):
127 if name in __block_openssl_constructor:
128 # Prefer our builtin blake2 implementation.
129 return __get_builtin_constructor(name)
130 try:
131 # MD5, SHA1, and SHA2 are in all supported OpenSSL versions
132 # SHA3/shake are available in OpenSSL 1.1.1+
133 f = getattr(_hashlib, 'openssl_' + name)
134 # Allow the C module to raise ValueError. The function will be
135 # defined but the hash not actually available. Don't fall back to
136 # builtin if the current security policy blocks a digest, bpo#40695.
137 f(usedforsecurity=False)
138 # Use the C function directly (very fast)
139 return f
140 except (AttributeError, ValueError):
141 return __get_builtin_constructor(name)
142
143
144def __py_new(name, *args, **kwargs):

Callers

nothing calls this directly

Calls 3

getattrFunction · 0.85
fFunction · 0.70

Tested by

no test coverage detected