aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-01-18 10:02:53 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-01-18 10:02:53 -0600
commitaca05e6c7d7efff451c3f149d0e9e12d34a63a9f (patch)
treed51943fcbda6863847fe41bfff4fe1e4c920da6c /tests/hazmat
parent836b830b155c1b04fbad40ab76f0de4339d8628c (diff)
downloadcryptography-aca05e6c7d7efff451c3f149d0e9e12d34a63a9f.tar.gz
cryptography-aca05e6c7d7efff451c3f149d0e9e12d34a63a9f.tar.bz2
cryptography-aca05e6c7d7efff451c3f149d0e9e12d34a63a9f.zip
various improvements to rsa_recover_prime_factors per review feedback
Diffstat (limited to 'tests/hazmat')
-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):