From ad89af11b234524e543284d3095a15905518ad70 Mon Sep 17 00:00:00 2001 From: Donald Stufft Date: Sat, 10 Aug 2013 16:01:56 -0400 Subject: Ensure that AES gets a proper key size --- tests/primitives/test_ciphers.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/primitives') diff --git a/tests/primitives/test_ciphers.py b/tests/primitives/test_ciphers.py index 31b4275e..891c5cf8 100644 --- a/tests/primitives/test_ciphers.py +++ b/tests/primitives/test_ciphers.py @@ -27,3 +27,7 @@ class TestAES(object): def test_key_size(self, key, keysize): cipher = AES(binascii.unhexlify(key)) assert cipher.key_size == keysize + + def test_invalid_key_size(self): + with pytest.raises(ValueError): + AES(binascii.unhexlify(b"0" * 12)) -- cgit v1.2.3