aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_rsa.py
diff options
context:
space:
mode:
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())