aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_rsa.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-07-07 17:51:18 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-07-07 17:51:18 -0700
commit7f68ccda2080c427f5e34b4ecc16cba9a030f2c6 (patch)
treeb18d9637c862303b4d4c5d9ae78111f9e099f196 /tests/hazmat/primitives/test_rsa.py
parent88d4a141dd25a87aa51fe66e5d048d5a1d14b157 (diff)
downloadcryptography-7f68ccda2080c427f5e34b4ecc16cba9a030f2c6.tar.gz
cryptography-7f68ccda2080c427f5e34b4ecc16cba9a030f2c6.tar.bz2
cryptography-7f68ccda2080c427f5e34b4ecc16cba9a030f2c6.zip
Restore these tests
Diffstat (limited to 'tests/hazmat/primitives/test_rsa.py')
-rw-r--r--tests/hazmat/primitives/test_rsa.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py
index 94cc6d3f..8e850737 100644
--- a/tests/hazmat/primitives/test_rsa.py
+++ b/tests/hazmat/primitives/test_rsa.py
@@ -1313,6 +1313,17 @@ class TestPSS(object):
assert pss._salt_length == padding.PSS.MAX_LENGTH
+class TestMGF1(object):
+ def test_invalid_hash_algorithm(self):
+ with pytest.raises(TypeError):
+ padding.MGF1(b"not_a_hash")
+
+ def test_valid_mgf1_parameters(self):
+ algorithm = hashes.SHA1()
+ mgf = padding.MGF1(algorithm)
+ assert mgf._algorithm == algorithm
+
+
class TestOAEP(object):
def test_invalid_algorithm(self):
mgf = padding.MGF1(hashes.SHA1())