summaryrefslogtreecommitdiff
path: root/passlib/tests
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2012-01-05 21:45:03 -0500
committerEli Collins <elic@assurancetechnologies.com>2012-01-05 21:45:03 -0500
commit87f536d8dff86e4bf2f237f0dd14f431621c9b9e (patch)
treebdc35667cfaa9638ecd2ccece842a398903392e2 /passlib/tests
parente6f618be80f36b9a7b1d4eed97e39c927120ea2e (diff)
downloadpasslib-87f536d8dff86e4bf2f237f0dd14f431621c9b9e.tar.gz
builtin implementations of md5_crypt and sha256/512_crypt sped up by about 25%
Diffstat (limited to 'passlib/tests')
-rw-r--r--passlib/tests/test_handlers.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/passlib/tests/test_handlers.py b/passlib/tests/test_handlers.py
index 5dc8d4f..be50b63 100644
--- a/passlib/tests/test_handlers.py
+++ b/passlib/tests/test_handlers.py
@@ -1086,6 +1086,22 @@ class _SHA256CryptTest(HandlerCase):
(u('with unic\u00D6de'), '$5$rounds=1000$IbG0EuGQXw5EkMdP$LQ5AfPf13KufFsKtmazqnzSGZ4pxtUNw3woQ.ELRDF4'),
]
+ if enable_option("cover"):
+ # rounds 1007-1012 ... sanity check for builtin alg added in 1.6,
+ # detects fencepost errors surrounding rounds that are multiples of 42.
+ # in this case, 1008 +/- 4
+ known_correct_hashes.extend([
+ ("secret", '$5$rounds=1004$nacl$oiWPbm.kQ7.jTCZoOtdv7/tO5mWv/vxw5yTqlBagVR7'),
+ ("secret", '$5$rounds=1005$nacl$6Mo/TmGDrXxg.bMK9isRzyWH3a..6HnSVVsJMEX7ud/'),
+ ("secret", '$5$rounds=1006$nacl$I46VwuAiUBwmVkfPFakCtjVxYYaOJscsuIeuZLbfKID'),
+ ("secret", '$5$rounds=1007$nacl$9fY4j1AV3N/dV/YMUn1enRHKH.7nEL4xf1wWB6wfDD4'),
+ ("secret", '$5$rounds=1008$nacl$CiFWCfn8ODmWs0I1xAdXFo09tM8jr075CyP64bu3by9'),
+ ("secret", '$5$rounds=1009$nacl$QtpFX.CJHgVQ9oAjVYStxAeiU38OmFILWm684c6FyED'),
+ ("secret", '$5$rounds=1010$nacl$ktAwXuT5WbjBW/0ZU1eNMpqIWY1Sm4twfRE1zbZyo.B'),
+ ("secret", '$5$rounds=1011$nacl$QJWLBEhO9qQHyMx4IJojSN9sS41P1Yuz9REddxdO721'),
+ ("secret", '$5$rounds=1012$nacl$mmf/k2PkbBF4VCtERgky3bEVavmLZKFwAcvxD1p3kV2'),
+ ])
+
known_malformed_hashes = [
#bad char in otherwise correct hash
'$5$rounds=10428$uy/:jIAhCetNCTtb0$YWvUOXbkqlqhyoPMpN8BMeZGsGx2aBvxTvDFI613c3',