mirror of
https://github.com/spring-projects/spring-security.git
synced 2026-03-05 03:04:31 +00:00
Previously the RsaSecretEncryptorTests were flaky because the assumed that a BadPaddigException would be thrown when using things like different salt. However, given that the tests had random inputs (e.g. keys) there is the possibility that, despite the fact that it can never be properly decrypted, the final bytes look like a valid encrypted value. This updates the tests to ensure that decrypt either throws an Exception or is not equal to the original plaintext.