Skip to content

Fix Flaky Crypto Tests#18843

Merged
rwinch merged 4 commits intospring-projects:mainfrom
rwinch:main-gh-18795-responsewrapper-header-overrides
Mar 3, 2026
Merged

Fix Flaky Crypto Tests#18843
rwinch merged 4 commits intospring-projects:mainfrom
rwinch:main-gh-18795-responsewrapper-header-overrides

Conversation

@rwinch
Copy link
Copy Markdown
Member

@rwinch rwinch commented Mar 3, 2026

Forward merge gh-18841

rwinch added 4 commits March 2, 2026 11:48
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.
@rwinch rwinch added this to the 7.1.0-M3 milestone Mar 3, 2026
@rwinch rwinch self-assigned this Mar 3, 2026
@rwinch rwinch added in: build An issue in the build in: crypto An issue in spring-security-crypto type: bug A general bug labels Mar 3, 2026
@rwinch rwinch enabled auto-merge March 3, 2026 22:00
@rwinch rwinch merged commit 2ac079d into spring-projects:main Mar 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: build An issue in the build in: crypto An issue in spring-security-crypto type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant