Skip to content

crypto: fix randomInt bias - #36894

Closed
tniessen wants to merge 1 commit into
nodejs:masterfrom
tniessen:crypto-fix-randomint-bias
Closed

crypto: fix randomInt bias#36894
tniessen wants to merge 1 commit into
nodejs:masterfrom
tniessen:crypto-fix-randomint-bias

Conversation

@tniessen

Copy link
Copy Markdown
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>
@tniessentniessen added crypto Issues and PRs related to the crypto subsystem. security Issues and PRs related to security. labels Jan 12, 2021
@tniessentniessen mentioned this pull request Jan 12, 2021
3 tasks
@nodejs-github-bot

nodejs-github-bot commented Jan 12, 2021

Copy link
Copy Markdown
Collaborator

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

nodejs-github-bot commented Jan 12, 2021

Copy link
Copy Markdown
Collaborator

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

@puzpuzpuzpuzpuzpuz added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 12, 2021
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 12, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@tniessen

Copy link
Copy Markdown
MemberAuthor

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

@tniessentniessen 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
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

nodejs-github-bot commented Jan 14, 2021

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
MemberAuthor

Landed in 4db9854, thanks for reviewing.

@tniessentniessen 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>
@ruyadornoruyadorno 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>
@danielleadamsdanielleadams mentioned this pull request May 3, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cryptoIssues and PRs related to the crypto subsystem.securityIssues and PRs related to security.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@tniessen@nodejs-github-bot@jasnell@puzpuzpuz