diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2019-09-11 12:12:30 +0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2019-09-11 00:12:30 -0400 |
commit | e575e3d482f976c4a1f3203d63ea0f5007a49a2a (patch) | |
tree | 64bd113778fc45b81d794dceb4bc16ee8db00a13 /tests/hazmat | |
parent | 7b2b3a65800b7c004399da5b3b6f431aa30946cc (diff) | |
download | cryptography-e575e3d482f976c4a1f3203d63ea0f5007a49a2a.tar.gz cryptography-e575e3d482f976c4a1f3203d63ea0f5007a49a2a.tar.bz2 cryptography-e575e3d482f976c4a1f3203d63ea0f5007a49a2a.zip |
update our test to be more robust wrt some changes from upstream (#4993)
Diffstat (limited to 'tests/hazmat')
-rw-r--r-- | tests/hazmat/primitives/test_dh.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/hazmat/primitives/test_dh.py b/tests/hazmat/primitives/test_dh.py index c667cd16..43f2ce5c 100644 --- a/tests/hazmat/primitives/test_dh.py +++ b/tests/hazmat/primitives/test_dh.py @@ -157,8 +157,15 @@ class TestDH(object): dh.generate_parameters(7, 512, backend) def test_dh_parameters_supported(self, backend): - assert backend.dh_parameters_supported(23, 5) - assert not backend.dh_parameters_supported(23, 18) + valid_p = int( + b"907c7211ae61aaaba1825ff53b6cb71ac6df9f1a424c033f4a0a41ac42fad3a9" + b"bcfc7f938a269710ed69e330523e4039029b7900977c740990d46efed79b9bbe" + b"73505ae878808944ce4d9c6c52daecc0a87dc889c53499be93db8551ee685f30" + b"349bf1b443d4ebaee0d5e8b441a40d4e8178f8f612f657a5eb91e0a8e" + b"107755f", 16 + ) + assert backend.dh_parameters_supported(valid_p, 5) + assert not backend.dh_parameters_supported(23, 22) @pytest.mark.parametrize( "vector", |