diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-06-30 00:15:42 -0500 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2016-06-30 01:15:42 -0400 |
commit | 10888813fc8a7e6a4b9cc7713ef1b92db4ad2809 (patch) | |
tree | 6608b01c58c0becaaf9435d3db24558ad268e234 /tests | |
parent | c9a9ec1e7a39949b1d09d72746fad6a1d681a80b (diff) | |
download | py-bcrypt-git-10888813fc8a7e6a4b9cc7713ef1b92db4ad2809.tar.gz |
Restore compatibility with 2.0.0's fix for wraparound bug (#81)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_bcrypt.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_bcrypt.py b/tests/test_bcrypt.py index ea5cee3..47f315a 100644 --- a/tests/test_bcrypt.py +++ b/tests/test_bcrypt.py @@ -430,3 +430,9 @@ def test_invalid_params(password, salt, desired_key_bytes, rounds, error): def test_bcrypt_assert(): with pytest.raises(SystemError): bcrypt._bcrypt_assert(False) + + +def test_2a_wraparound_bug(): + assert bcrypt.hashpw( + (b"0123456789" * 26)[:255], b"$2a$04$R1lJ2gkNaoPGdafE.H.16." + ) == b"$2a$04$R1lJ2gkNaoPGdafE.H.16.1MKHPvmKwryeulRe225LKProWYwt9Oi" |