◐ Shell
clean mode source ↗

crypto: unify validation of checkPrime checks by tniessen · Pull Request #47165 · nodejs/node

@nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

crypto

Issues and PRs related to the crypto subsystem.

needs-ci

PRs that need a full CI run.

labels

Mar 19, 2023

bnoordhuis

Previously, the JS layer would validate that the value of the 'checks'
option was an unsigned 32-bit integer, otherwise throwing an appropriate
error but with a slightly misleading error message. Then the C++ layer
would validate that the value was an unsigned 31-bit integer, otherwise
throwing an appropriate error, but with a different (and even less
helpful) error message.

Instead, make the JS layer aware of the 31-bit restriction so that no
validation in C++ is necessary and so that the error message always
matches the exact requirement.

@tniessen tniessen added author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

request-ci

Add this label to start a Jenkins CI on a PR.

labels

Mar 20, 2023

This was referenced

Mar 21, 2023

RafaelGSS pushed a commit that referenced this pull request

Apr 5, 2023
Previously, the JS layer would validate that the value of the 'checks'
option was an unsigned 32-bit integer, otherwise throwing an appropriate
error but with a slightly misleading error message. Then the C++ layer
would validate that the value was an unsigned 31-bit integer, otherwise
throwing an appropriate error, but with a different (and even less
helpful) error message.

Instead, make the JS layer aware of the 31-bit restriction so that no
validation in C++ is necessary and so that the error message always
matches the exact requirement.

PR-URL: #47165
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

RafaelGSS pushed a commit that referenced this pull request

Apr 7, 2023
Previously, the JS layer would validate that the value of the 'checks'
option was an unsigned 32-bit integer, otherwise throwing an appropriate
error but with a slightly misleading error message. Then the C++ layer
would validate that the value was an unsigned 31-bit integer, otherwise
throwing an appropriate error, but with a different (and even less
helpful) error message.

Instead, make the JS layer aware of the 31-bit restriction so that no
validation in C++ is necessary and so that the error message always
matches the exact requirement.

PR-URL: #47165
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

danielleadams pushed a commit that referenced this pull request

Jul 6, 2023
Previously, the JS layer would validate that the value of the 'checks'
option was an unsigned 32-bit integer, otherwise throwing an appropriate
error but with a slightly misleading error message. Then the C++ layer
would validate that the value was an unsigned 31-bit integer, otherwise
throwing an appropriate error, but with a different (and even less
helpful) error message.

Instead, make the JS layer aware of the 31-bit restriction so that no
validation in C++ is necessary and so that the error message always
matches the exact requirement.

PR-URL: #47165
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>