Backport random util fips fixes to 8.x#367
Open
jpartlow wants to merge 6 commits into
Open
Conversation
Chunk large RandomStringUtils calls to stay under the BC FIPS DRBG per-request limit (262144 bits / 32768 bytes), which was causing generate tests to fail under the FIPS profile. - add random-ascii-string helper in cli/generate.clj and use it in add-blob - add alphabetic-string helper in random.clj and route random-string/ random-string-alpha through it - use StringBuilder-based chunk assembly to reduce intermediate allocations - add local type hints on interop targets to avoid reflection noise Co-authored-by: GitHub Copilot <copilot@users.noreply.github.com> Signed-off-by: Corporate Gadfly <haroon.rafique@gmail.com>
So that it is contained with the rest of the random functions there. Signed-off-by: Josh Partlow <jpartlow@glatisant.org>
Formerly the 0-arity case wasn't lowercasing. Also update random-string to use alphabetic-string for it's 0-arity case to keep it inline with the 1-arity case. Signed-off-by: Josh Partlow <jpartlow@glatisant.org>
...from near identical alphabetic-string and random-ascii-string. Also adds a bit of test coverage for these functions and some of their adjacents. Signed-off-by: Josh Partlow <jpartlow@glatisant.org>
Fixes another area where FIPS DRBG per-request-limits could crop up in benchmark.clj. RandomStringUtils is only referenced in random.clj now. Signed-off-by: Josh Partlow <jpartlow@glatisant.org>
Contributor
Author
|
@corporate-gadfly These were the set I noticed from main that look related, but there might be other earlier commits that need to come over? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request (PR) description
Backports from main of a set of changes around random number generation for FIPS.
This Pull Request (PR) fixes the following issues