We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 086c3ae commit 0f26158Copy full SHA for 0f26158
Lib/test/test_crypt.py
@@ -57,7 +57,13 @@ def test_log_rounds(self):
57
def test_invalid_log_rounds(self):
58
for log_rounds in (1, -1, 999):
59
salt = crypt.mksalt(crypt.METHOD_BLOWFISH, log_rounds=log_rounds)
60
- self.assertIsNone(crypt.crypt('mypassword', salt))
+ cr = crypt.crypt('mypassword', salt)
61
+ if cr is not None:
62
+ # On failure the openwall implementation returns a magic
63
+ # string that is shorter than 13 characters and is guaranteed
64
+ # to differ from a salt.
65
+ self.assertNotEqual(cr, salt)
66
+ self.assertLess(len(cr), 13)
67
68
69
if __name__ == "__main__":
0 commit comments