diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-07-07 17:51:18 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-07-07 17:51:18 -0700 |
commit | 7f68ccda2080c427f5e34b4ecc16cba9a030f2c6 (patch) | |
tree | b18d9637c862303b4d4c5d9ae78111f9e099f196 | |
parent | 88d4a141dd25a87aa51fe66e5d048d5a1d14b157 (diff) | |
download | cryptography-7f68ccda2080c427f5e34b4ecc16cba9a030f2c6.tar.gz cryptography-7f68ccda2080c427f5e34b4ecc16cba9a030f2c6.tar.bz2 cryptography-7f68ccda2080c427f5e34b4ecc16cba9a030f2c6.zip |
Restore these tests
-rw-r--r-- | tests/hazmat/primitives/test_rsa.py | 11 |
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()) |