diff options
author | David Reid <dreid@dreid.org> | 2013-10-31 20:23:59 -0700 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2013-10-31 20:23:59 -0700 |
commit | 3620b6080a4c33e97f37c619d3f8f5fdc1041a5c (patch) | |
tree | aad2ec68ef13ad3be28bdf6fb744649f5a0bd9b0 /tests | |
parent | 0419e5ef5f8b4f068cc30e006c55158de914c366 (diff) | |
parent | d09f3e1448ee593cff51e9d9f6a923b273b83b4a (diff) | |
download | cryptography-3620b6080a4c33e97f37c619d3f8f5fdc1041a5c.tar.gz cryptography-3620b6080a4c33e97f37c619d3f8f5fdc1041a5c.tar.bz2 cryptography-3620b6080a4c33e97f37c619d3f8f5fdc1041a5c.zip |
Merge pull request #208 from reaperhulk/skip-check-blowfish
Add skipif checks for blowfish
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/primitives/test_blowfish.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_blowfish.py b/tests/hazmat/primitives/test_blowfish.py index 64ce5175..cd5e03a4 100644 --- a/tests/hazmat/primitives/test_blowfish.py +++ b/tests/hazmat/primitives/test_blowfish.py @@ -29,6 +29,10 @@ class TestBlowfish(object): ["bf-ecb.txt"], lambda key: ciphers.Blowfish(binascii.unhexlify(key)), lambda key: modes.ECB(), + only_if=lambda backend: backend.ciphers.supported( + ciphers.Blowfish("\x00" * 56), modes.ECB() + ), + skip_message="Does not support Blowfish ECB", ) test_CBC = generate_encrypt_test( @@ -37,6 +41,10 @@ class TestBlowfish(object): ["bf-cbc.txt"], lambda key, iv: ciphers.Blowfish(binascii.unhexlify(key)), lambda key, iv: modes.CBC(binascii.unhexlify(iv)), + only_if=lambda backend: backend.ciphers.supported( + ciphers.Blowfish("\x00" * 56), modes.CBC("\x00" * 8) + ), + skip_message="Does not support Blowfish CBC", ) test_OFB = generate_encrypt_test( @@ -45,6 +53,10 @@ class TestBlowfish(object): ["bf-ofb.txt"], lambda key, iv: ciphers.Blowfish(binascii.unhexlify(key)), lambda key, iv: modes.OFB(binascii.unhexlify(iv)), + only_if=lambda backend: backend.ciphers.supported( + ciphers.Blowfish("\x00" * 56), modes.OFB("\x00" * 8) + ), + skip_message="Does not support Blowfish OFB", ) test_CFB = generate_encrypt_test( @@ -53,4 +65,8 @@ class TestBlowfish(object): ["bf-cfb.txt"], lambda key, iv: ciphers.Blowfish(binascii.unhexlify(key)), lambda key, iv: modes.CFB(binascii.unhexlify(iv)), + only_if=lambda backend: backend.ciphers.supported( + ciphers.Blowfish("\x00" * 56), modes.CFB("\x00" * 8) + ), + skip_message="Does not support Blowfish CFB", ) |