Added a test for pbkdf2()'s default digest algorithm.
@@ -140,3 +140,7 @@ class TestUtilsCryptoPBKDF2(unittest.TestCase):
result = pbkdf2(**vector['args'])
self.assertEqual(binascii.hexlify(result).decode('ascii'),
vector['result'])
+
+ def test_default_hmac_alg(self):
+ kwargs = {'password': b'password', 'salt': b'salt', 'iterations': 1, 'dklen': 20}
+ self.assertEqual(pbkdf2(**kwargs), hashlib.pbkdf2_hmac(hash_name=hashlib.sha256().name, **kwargs))
