From 35bb89a4dbd0b9b5795ac1938db09ca42887b715 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 25 Aug 2014 13:10:49 -0700 Subject: Verify that padding is an instance of AsymmetircPadding before trying to use it; fixes #1318 --- tests/hazmat/primitives/test_rsa.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index e53ff06b..88b30d61 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -1616,6 +1616,8 @@ class TestRSAEncryption(object): with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_PADDING): public_key.encrypt(b"somedata", DummyPadding()) + with pytest.raises(TypeError): + public_key.encrypt(b"somedata", padding=object()) def test_unsupported_oaep_mgf(self, backend): private_key = RSA_KEY_512.private_key(backend) -- cgit v1.2.3