aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-02-06 21:06:18 +0000
committerAlex Stapleton <alexs@prol.etari.at>2014-02-06 21:15:47 +0000
commit4eaab17b738963335c76cfafafee44fef8203dee (patch)
treedcb0b2f3febd8be901aa80d12fe0e7e7f8a43c9d /tests
parent7d69d3a831abfdfadf014ece0b324d406742d286 (diff)
downloadcryptography-4eaab17b738963335c76cfafafee44fef8203dee.tar.gz
cryptography-4eaab17b738963335c76cfafafee44fef8203dee.tar.bz2
cryptography-4eaab17b738963335c76cfafafee44fef8203dee.zip
More sanity checks
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_rsa.py12
1 files changed, 12 insertions, 0 deletions
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)