diff options
author | Terry Chia <terrycwk1994@gmail.com> | 2016-11-15 09:56:02 +0800 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-11-15 09:56:02 +0800 |
commit | e9b87d5de47008ddf6fcc6e07deb662cbe376c64 (patch) | |
tree | 162719213c18edc62d9d95b36a8073cbcf986d97 /tests/hypothesis | |
parent | 9977786b56294292fb7da9eabc0f3b94d638e8a7 (diff) | |
download | cryptography-e9b87d5de47008ddf6fcc6e07deb662cbe376c64.tar.gz cryptography-e9b87d5de47008ddf6fcc6e07deb662cbe376c64.tar.bz2 cryptography-e9b87d5de47008ddf6fcc6e07deb662cbe376c64.zip |
Raise padding block_size limit to what is allowed by the specs. (#3108)
* Raize padding block_size limit to what is allowed by the specs.
* Add tests for raising padding limits.
* Amend C code for padding check to use uint16_t instead of uint8_t.
* Fix test to work in Python 3.
* Fix typo.
* Fix another typo.
* Fix return type of the padding checks.
* Change hypothesis test on padding.
* Update comment.
Diffstat (limited to 'tests/hypothesis')
-rw-r--r-- | tests/hypothesis/test_padding.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/hypothesis/test_padding.py b/tests/hypothesis/test_padding.py index 29d726f1..a4333917 100644 --- a/tests/hypothesis/test_padding.py +++ b/tests/hypothesis/test_padding.py @@ -8,7 +8,7 @@ from hypothesis.strategies import binary, integers from cryptography.hazmat.primitives.padding import ANSIX923, PKCS7 -@given(integers(min_value=1, max_value=31), binary()) +@given(integers(min_value=1, max_value=255), binary()) def test_pkcs7(block_size, data): # Generate in [1, 31] so we can easily get block_size in bits by # multiplying by 8. @@ -21,7 +21,7 @@ def test_pkcs7(block_size, data): assert unpadder.update(padded) + unpadder.finalize() == data -@given(integers(min_value=1, max_value=31), binary()) +@given(integers(min_value=1, max_value=255), binary()) def test_ansix923(block_size, data): a = ANSIX923(block_size=block_size * 8) padder = a.padder() |