mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-47101: list only activated algorithms in hashlib.algorithms_available (GH-32076)
This commit is contained in:
parent
c62b944dfc
commit
48e2010d92
3 changed files with 20 additions and 1 deletions
|
@ -223,6 +223,10 @@ class HashLibTestCase(unittest.TestCase):
|
|||
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