Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: fix randomInt bias #36894

Closed
wants to merge 1 commit into from

Conversation

tniessen
Copy link
Member

@puzpuzpuz found this issue in #35110 (comment). Opening a separate PR to make sure this fix can land and be backported quickly, if necessary.

This patch also changes a few comments and definitions to make the necessary conditions easier to understand.

The actual effect of this bias is small, but the mere existence of bias defeats the purpose of this function.

Refs: #34600

Co-authored-by: Andrey Pechkurov <apechkurov@gmail.com>
@tniessen tniessen added crypto Issues and PRs related to the crypto subsystem. security Issues and PRs related to security. labels Jan 12, 2021
@tniessen tniessen requested a review from puzpuzpuz January 12, 2021 15:04
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jan 12, 2021

CI: https://ci.nodejs.org/job/node-test-pull-request/35470/

Infrastructure failure:

16:41:06 FATAL: Server returned HTTP response code: 502 for URL: https://raw.githubusercontent.com/nodejs/build/master/jenkins/scripts/VersionSelectorScript.groovy?a
16:41:06 java.io.IOException: Server returned HTTP response code: 502 for URL: https://raw.githubusercontent.com/nodejs/build/master/jenkins/scripts/VersionSelectorScript.groovy?a

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jan 12, 2021

CI: https://ci.nodejs.org/job/node-test-pull-request/35471/

Infrastructure failure:

16:42:04 + bash -ex -s before
16:42:04 + curl https://raw.githubusercontent.com/nodejs/build/master/jenkins/scripts/node-test-commit-pre.sh
16:42:04   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
16:42:04                                  Dload  Upload   Total   Spent    Left  Speed
16:42:04 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100    18  100    18    0     0     86      0 --:--:-- --:--:-- --:--:--    87
16:42:04 + connection failure
16:42:04 bash: line 1: connection: command not found
16:42:04 Build step 'Execute shell' marked build as failure

@puzpuzpuz puzpuzpuz added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 12, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 12, 2021
@nodejs-github-bot
Copy link
Collaborator

@tniessen
Copy link
Member Author

The asan failure seems related to #36779 and is unrelated to this change.

@tniessen tniessen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 12, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jan 14, 2021

tniessen added a commit that referenced this pull request Jan 14, 2021
Co-authored-by: Andrey Pechkurov <apechkurov@gmail.com>

PR-URL: #36894
Refs: #34600
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@tniessen
Copy link
Member Author

Landed in 4db9854, thanks for reviewing.

@tniessen tniessen closed this Jan 14, 2021
@tniessen tniessen removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 14, 2021
@tniessen tniessen deleted the crypto-fix-randomint-bias branch January 15, 2021 17:14
ruyadorno pushed a commit that referenced this pull request Jan 22, 2021
Co-authored-by: Andrey Pechkurov <apechkurov@gmail.com>

PR-URL: #36894
Refs: #34600
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@ruyadorno ruyadorno mentioned this pull request Jan 22, 2021
targos pushed a commit that referenced this pull request May 1, 2021
Co-authored-by: Andrey Pechkurov <apechkurov@gmail.com>

PR-URL: #36894
Refs: #34600
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem. security Issues and PRs related to security.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants