Skip to content

Commit

Permalink
Add tests for possible loop/DoS in rsa_recover_prime_factors()
Browse files Browse the repository at this point in the history
  • Loading branch information
hannob committed Jan 12, 2025
1 parent 369b67c commit 2e4a9e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/hazmat/primitives/test_rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -2400,6 +2400,10 @@ def test_invalid_recover_prime_factors(self):
rsa.rsa_recover_prime_factors(34, 3, 7)
with pytest.raises(ValueError):
rsa.rsa_recover_prime_factors(629, 17, 20)
with pytest.raises(ValueError):
rsa.rsa_recover_prime_factors(21, 1, 1)
with pytest.raises(ValueError):
rsa.rsa_recover_prime_factors(21, -1, -1)


class TestRSAPrivateKeySerialization:
Expand Down

0 comments on commit 2e4a9e0

Please sign in to comment.