Uh oh!
There was an error while loading. Please reload this page.
crypto: remove INT_MAX restriction in randomBytes - #47559
Merged
nodejs-github-bot merged 1 commit intoApr 17, 2023
Merged
Conversation
This restriction was due to an implementation detail in CSPRNG(). Now that CSPRNG() properly handles lengths exceeding INT_MAX, remove this artificial restriction. Refs: nodejs#47515
nodejs-github-bot
commented
Apr 14, 2023
Collaborator
Review requested:
|
This comment was marked as outdated.
This comment was marked as outdated.
anonrig
approved these changes
Apr 14, 2023
bnoordhuis
commented
Apr 15, 2023
Member
So... on the one hand I feel arbitrary limitations are bad. On the other hand, there isn't ever a good reason to request so much random data. It's more likely the result of buggy code than really wanting to grab gigabytes of randomness. Bugs like that are also angle for resource exhaustion bugs (thread pool starvation in this case) so ceteris paribus rather than increasing the limit I suggest lowering it. |
tniessen
commented
Apr 15, 2023
MemberAuthor
That's a valid point, but if someone wants to introduce an explicit smaller limit (and for a different reason), I think that should be a separate discussion/change, especially considering that it would be semver-major. |
bnoordhuis
commented
Apr 15, 2023
Member
Fair enough. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
nodejs-github-bot
commented
Apr 16, 2023
Collaborator
panva
approved these changes
Apr 17, 2023
nodejs-github-bot
commented
Apr 17, 2023
Collaborator
Landed in b342a1b |
35 tasks
MoLow pushed a commit
to MoLow/node
that referenced
this pull request
Jul 6, 2023
This restriction was due to an implementation detail in CSPRNG(). Now that CSPRNG() properly handles lengths exceeding INT_MAX, remove this artificial restriction. Refs: nodejs#47515 PR-URL: nodejs#47559 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
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 freeto 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.
This restriction was due to an implementation detail in
CSPRNG(). Now thatCSPRNG()properly handles lengths exceedingINT_MAX, remove this artificial restriction.Refs: #47515