aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-06-12 08:22:52 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-06-12 08:26:06 -0500
commit0760974cd993b2cf926561b6dd93fe7935edbb2d (patch)
tree2358086759d5e2e4828cd8b215aee8634120d26e
parent8f568e0b29e7f734b0e18fe136b6dcad4bf9dc83 (diff)
downloadcryptography-0760974cd993b2cf926561b6dd93fe7935edbb2d.tar.gz
cryptography-0760974cd993b2cf926561b6dd93fe7935edbb2d.tar.bz2
cryptography-0760974cd993b2cf926561b6dd93fe7935edbb2d.zip
don't do value checks in the numbers
-rw-r--r--cryptography/hazmat/primitives/asymmetric/rsa.py4
-rw-r--r--tests/hazmat/primitives/test_rsa.py8
2 files changed, 4 insertions, 8 deletions
diff --git a/cryptography/hazmat/primitives/asymmetric/rsa.py b/cryptography/hazmat/primitives/asymmetric/rsa.py
index a4e6cb71..be7edad3 100644
--- a/cryptography/hazmat/primitives/asymmetric/rsa.py
+++ b/cryptography/hazmat/primitives/asymmetric/rsa.py
@@ -314,8 +314,6 @@ class RSAPrivateNumbers(object):
" instance."
)
- _check_private_key_components(p, q, d, dmp1, dmq1, iqmp,
- public_numbers.e, public_numbers.n)
self._p = p
self._q = q
self._d = d
@@ -361,8 +359,6 @@ class RSAPublicNumbers(object):
):
raise TypeError("RSAPublicNumbers arguments must be integers.")
- _check_public_key_components(e, n)
-
self._e = e
self._n = n
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py
index cfb51b0b..8f10fb10 100644
--- a/tests/hazmat/primitives/test_rsa.py
+++ b/tests/hazmat/primitives/test_rsa.py
@@ -1681,12 +1681,12 @@ class TestRSAEncryption(object):
@pytest.mark.rsa
class TestRSANumbers(object):
def test_rsa_public_numbers(self):
- public_numbers = rsa.RSAPublicNumbers(e=3, n=15)
- assert public_numbers.e == 3
+ public_numbers = rsa.RSAPublicNumbers(e=1, n=15)
+ assert public_numbers.e == 1
assert public_numbers.n == 15
def test_rsa_private_numbers(self):
- public_numbers = rsa.RSAPublicNumbers(e=3, n=15)
+ public_numbers = rsa.RSAPublicNumbers(e=1, n=15)
private_numbers = rsa.RSAPrivateNumbers(
p=3,
q=5,
@@ -1713,7 +1713,7 @@ class TestRSANumbers(object):
rsa.RSAPublicNumbers(e=1, n=None)
def test_private_numbers_invalid_types(self):
- public_numbers = rsa.RSAPublicNumbers(e=3, n=15)
+ public_numbers = rsa.RSAPublicNumbers(e=1, n=15)
with pytest.raises(TypeError):
rsa.RSAPrivateNumbers(