| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3f59b55 commit 4cc2f93
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -127,8 +127,9 @@ def __get_openssl_constructor(name): | |||
| 127 | 127 | # SHA3/shake are available in OpenSSL 1.1.1+ | |
| 128 | 128 | f = getattr(_hashlib, 'openssl_' + name) | |
| 129 | 129 | # Allow the C module to raise ValueError. The function will be | |
| 130 | - # defined but the hash not actually available thanks to OpenSSL. | ||
| 131 | - f() | ||
| 130 | + # defined but the hash not actually available. Don't fall back to | ||
| 131 | + # builtin if the current security policy blocks a digest, bpo#40695. | ||
| 132 | + f(usedforsecurity=False) | ||
| 132 | 133 | # Use the C function directly (very fast) | |
| 133 | 134 | return f | |
| 134 | 135 | except (AttributeError, ValueError): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + :mod:`hashlib` no longer falls back to builtin hash implementations when | ||
| 2 | + OpenSSL provides a hash digest and the algorithm is blocked by security | ||
| 3 | + policy. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments