Skip to content

Use default SecureRandom in identifier generator - #703

Open
mhalbritter wants to merge 1 commit into
spring-projects:mainfrom
mhalbritter:mh/remove-secure-random-os-check
Open

mhalbritter wants to merge 1 commit into
spring-projects:mainfrom
mhalbritter:mh/remove-secure-random-os-check

Conversation

@mhalbritter

@mhalbritter mhalbritter commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

The OS-specific algorithm list never picked the first available algorithm because the loop did not stop on success. On Linux this always resulted in SHA1PRNG. There's a return or break missing in the for (String algorithm : OsTools.secureRandomAlgorithmNames()) { loop.

After some digging, it turns out that the loop is unnecessary. The JDK default already selects a suitable non-blocking generator per platform and respects java.security configuration.

The OS-specific algorithm list never picked the first available
algorithm because the loop did not stop on success. On Linux this
always resulted in SHA1PRNG.

The JDK default already selects a suitable non-blocking generator per
platform and respects java.security configuration, so the list is
unnecessary.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 19, 2026
@mp911de mp911de added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants