mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
bpo-47101: list only activated algorithms in hashlib.algorithms_available (GH-32076)
(cherry picked from commit 48e2010d92)
Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
e513b8188a
commit
ec3589f59d
3 changed files with 20 additions and 1 deletions
|
|
@ -223,6 +223,10 @@ def test_algorithms_guaranteed(self):
|
|||
def test_algorithms_available(self):
|
||||
self.assertTrue(set(hashlib.algorithms_guaranteed).
|
||||
issubset(hashlib.algorithms_available))
|
||||
# all available algorithms must be loadable, bpo-47101
|
||||
self.assertNotIn("undefined", hashlib.algorithms_available)
|
||||
for name in hashlib.algorithms_available:
|
||||
digest = hashlib.new(name, usedforsecurity=False)
|
||||
|
||||
def test_usedforsecurity_true(self):
|
||||
hashlib.new("sha256", usedforsecurity=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue