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: runtime deprecate replaced rsa-pss keygen parameters #45653

Merged
merged 1 commit into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2973,12 +2973,15 @@ option, or a non-nullish non-boolean value for `verbatim` option in

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/45653
description: Runtime deprecation.
- version: v16.10.0
pr-url: https://github.com/nodejs/node/pull/39927
description: Documentation-only deprecation.
-->

Type: Documentation-only (supports [`--pending-deprecation`][])
Type: Runtime

The `'hash'` and `'mgf1Hash'` options are replaced with `'hashAlgorithm'`
and `'mgf1HashAlgorithm'`.
Expand Down
8 changes: 2 additions & 6 deletions lib/internal/crypto/keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ const {

const { isArrayBufferView } = require('internal/util/types');

const { getOptionValue } = require('internal/options');

function isJwk(obj) {
return obj != null && obj.kty !== undefined;
}
Expand Down Expand Up @@ -204,16 +202,14 @@ function createJob(mode, type, options) {
hash, mgf1Hash, hashAlgorithm, mgf1HashAlgorithm, saltLength
} = options;

const pendingDeprecation = getOptionValue('--pending-deprecation');

if (saltLength !== undefined)
validateInt32(saltLength, 'options.saltLength', 0);
if (hashAlgorithm !== undefined)
validateString(hashAlgorithm, 'options.hashAlgorithm');
if (mgf1HashAlgorithm !== undefined)
validateString(mgf1HashAlgorithm, 'options.mgf1HashAlgorithm');
if (hash !== undefined) {
pendingDeprecation && process.emitWarning(
process.emitWarning(
'"options.hash" is deprecated, ' +
'use "options.hashAlgorithm" instead.',
'DeprecationWarning',
Expand All @@ -224,7 +220,7 @@ function createJob(mode, type, options) {
}
}
if (mgf1Hash !== undefined) {
pendingDeprecation && process.emitWarning(
process.emitWarning(
'"options.mgf1Hash" is deprecated, ' +
'use "options.mgf1HashAlgorithm" instead.',
'DeprecationWarning',
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-crypto-keygen-deprecation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Flags: --pending-deprecation

'use strict';

const common = require('../common');
Expand Down