Skip to content

Fix Flaky Crypto Tests#18842

Merged
rwinch merged 2 commits intospring-projects:7.0.xfrom
rwinch:7.0.x-gh-18795-responsewrapper-header-overrides
Mar 3, 2026
Merged

Fix Flaky Crypto Tests#18842
rwinch merged 2 commits intospring-projects:7.0.xfrom
rwinch:7.0.x-gh-18795-responsewrapper-header-overrides

Conversation

@rwinch
Copy link
Copy Markdown
Member

@rwinch rwinch commented Mar 3, 2026

Forward merge gh-18841

rwinch added 2 commits March 3, 2026 14:52
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.0.4 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 status: forward-port An issue tracking the forward-port of a change made in an earlier branch labels Mar 3, 2026
@rwinch rwinch enabled auto-merge March 3, 2026 21:48
@rwinch rwinch merged commit 04b270a into spring-projects:7.0.x Mar 3, 2026
6 checks passed
@rwinch rwinch deleted the 7.0.x-gh-18795-responsewrapper-header-overrides branch March 3, 2026 22:03
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 status: forward-port An issue tracking the forward-port of a change made in an earlier branch type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant