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.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py
index 3de228bb..33e5373b 100644
--- a/tests/hazmat/primitives/test_rsa.py
+++ b/tests/hazmat/primitives/test_rsa.py
@@ -1719,14 +1719,8 @@ class TestRSAPrimeFactorRecovery(object):
# 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
# NIST vectors are not so consistent. Accordingly we verify we've
- # recovered the proper (p, q) by being willing to match against either
- # one and then altering the asserts accordingly.
- if p == private["p"]:
- assert p == private["p"]
- assert q == private["q"]
- else:
- assert p == private["q"]
- assert q == private["p"]
+ # recovered the proper (p, q) by sorting them and asserting on that.
+ assert sorted([p, q]) == sorted([private["p"], private["q"]])
def test_invalid_recover_prime_factors(self):
with pytest.raises(ValueError):