aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-04-15 14:16:35 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-04-20 16:53:03 -0500
commit7bdcdc175675bc78edaa7e0f931676652ab7a427 (patch)
treef33ccfc69cb384debea40eef14454667a15bd620 /tests/hazmat/primitives
parent4d7d44e1be9f4bfe0aae9e395b231f34d431aaaf (diff)
downloadcryptography-7bdcdc175675bc78edaa7e0f931676652ab7a427.tar.gz
cryptography-7bdcdc175675bc78edaa7e0f931676652ab7a427.tar.bz2
cryptography-7bdcdc175675bc78edaa7e0f931676652ab7a427.zip
remove OAEP decryption to simplify review
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r--tests/hazmat/primitives/test_rsa.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py
index c43fd0b5..74a0c111 100644
--- a/tests/hazmat/primitives/test_rsa.py
+++ b/tests/hazmat/primitives/test_rsa.py
@@ -1227,54 +1227,12 @@ class TestMGF1(object):
assert mgf._salt_length == padding.MGF1.MAX_LENGTH
-class TestOAEP(object):
- def test_invalid_algorithm(self):
- mgf = padding.MGF1(hashes.SHA1())
- with pytest.raises(TypeError):
- padding.OAEP(
- mgf=mgf,
- algorithm=b"",
- label=None
- )
-
-
@pytest.mark.rsa
class TestRSADecryption(object):
@pytest.mark.parametrize(
"vector",
_flatten_pkcs1_examples(load_vectors_from_file(
os.path.join(
- "asymmetric", "RSA", "pkcs-1v2-1d2-vec", "oaep-vect.txt"),
- load_pkcs1_vectors
- ))
- )
- def test_decrypt_oaep_vectors(self, vector, backend):
- private, public, example = vector
- skey = rsa.RSAPrivateKey(
- p=private["p"],
- q=private["q"],
- private_exponent=private["private_exponent"],
- dmp1=private["dmp1"],
- dmq1=private["dmq1"],
- iqmp=private["iqmp"],
- public_exponent=private["public_exponent"],
- modulus=private["modulus"]
- )
- message = skey.decrypt(
- binascii.unhexlify(example["encryption"]),
- padding.OAEP(
- mgf=padding.MGF1(algorithm=hashes.SHA1()),
- algorithm=hashes.SHA1(),
- label=None
- ),
- backend
- )
- assert message == binascii.unhexlify(example["message"])
-
- @pytest.mark.parametrize(
- "vector",
- _flatten_pkcs1_examples(load_vectors_from_file(
- os.path.join(
"asymmetric", "RSA", "pkcs1v15crypt-vectors.txt"),
load_pkcs1_vectors
))
@@ -1307,23 +1265,6 @@ class TestRSADecryption(object):
with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_PADDING):
private_key.decrypt(b"somedata", DummyPadding(), backend)
- def test_unsupported_oaep_mgf(self, backend):
- private_key = rsa.RSAPrivateKey.generate(
- public_exponent=65537,
- key_size=512,
- backend=backend
- )
- with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_MGF):
- private_key.decrypt(
- b"ciphertext",
- padding.OAEP(
- mgf=DummyMGF(),
- algorithm=hashes.SHA1(),
- label=None
- ),
- backend
- )
-
def test_decrypt_invalid_decrypt(self, backend):
private_key = rsa.RSAPrivateKey.generate(
public_exponent=65537,