From 0edf7993c66bf8e78803d771d49f5e214dbe3815 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 19 Jul 2016 21:12:59 +0200 Subject: Enforce that p > q to improve OpenSSL compatibility (fixes #2990) (#3010) --- tests/hazmat/primitives/test_rsa.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index e4e43780..81e3f946 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -1985,10 +1985,11 @@ class TestRSAPrimeFactorRecovery(object): private["private_exponent"] ) # Unfortunately there is no convention on which prime should be p - # and which one q. The function we use always makes p < q, but the + # and which one q. The function we use always makes p > q, but the # NIST vectors are not so consistent. Accordingly, we verify we've # recovered the proper (p, q) by sorting them and asserting on that. assert sorted([p, q]) == sorted([private["p"], private["q"]]) + assert p > q def test_invalid_recover_prime_factors(self): with pytest.raises(ValueError): -- cgit v1.2.3