Issue #26390: Fix and test pbkdf2_hmac() parameter names

Based on patch by Daan Bakker.
This commit is contained in:
Martin Panter 2016-02-22 09:21:49 +00:00
parent 8c16cb9f65
commit bc85e35fe6
2 changed files with 10 additions and 6 deletions

View file

@ -513,6 +513,9 @@ class KDFTests(unittest.TestCase):
self.assertRaises(ValueError, pbkdf2, 'sha1', b'pass', b'salt', 1, -1)
with self.assertRaisesRegex(ValueError, 'unsupported hash type'):
pbkdf2('unknown', b'pass', b'salt', 1)
out = pbkdf2(hash_name='sha1', password=b'password', salt=b'salt',
iterations=1, dklen=None)
self.assertEqual(out, self.pbkdf2_results['sha1'][0][0])
def test_pbkdf2_hmac_py(self):
self._test_pbkdf2_hmac(py_hashlib.pbkdf2_hmac)