From 4eaab17b738963335c76cfafafee44fef8203dee Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Thu, 6 Feb 2014 21:06:18 +0000 Subject: More sanity checks --- tests/hazmat/primitives/test_rsa.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index 5b1b3658..35207c11 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -72,6 +72,18 @@ class TestRSA(object): with pytest.raises(ValueError): rsa.RSAPrivateKey(3, 5, 14, 8, 2) + # modulus wrong + with pytest.raises(ValueError): + rsa.RSAPrivateKey(3, 5, 14, 8, 16) + + # p too high + with pytest.raises(ValueError): + rsa.RSAPrivateKey(16, 5, 14, 8, 15) + + # q too high + with pytest.raises(ValueError): + rsa.RSAPrivateKey(3, 16, 14, 8, 15) + # private exp too high with pytest.raises(ValueError): rsa.RSAPrivateKey(3, 5, 16, 8, 15) -- cgit v1.2.3