Skip to content

Commit f2264f3

Browse files
committed
crypto: runtime deprecate replaced rsa-pss keygen parameters
1 parent 58b60c1 commit f2264f3

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2973,12 +2973,15 @@ option, or a non-nullish non-boolean value for `verbatim` option in
29732973

29742974
<!-- YAML
29752975
changes:
2976+
- version: REPLACEME
2977+
pr-url: https://github.com/nodejs/node/pull/45653
2978+
description: Runtime deprecation.
29762979
- version: v16.10.0
29772980
pr-url: https://github.com/nodejs/node/pull/39927
29782981
description: Documentation-only deprecation.
29792982
-->
29802983

2981-
Type: Documentation-only (supports [`--pending-deprecation`][])
2984+
Type: Runtime
29822985

29832986
The `'hash'` and `'mgf1Hash'` options are replaced with `'hashAlgorithm'`
29842987
and `'mgf1HashAlgorithm'`.

lib/internal/crypto/keygen.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ const {
6363

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

66-
const { getOptionValue } = require('internal/options');
67-
6866
function isJwk(obj) {
6967
return obj != null && obj.kty !== undefined;
7068
}
@@ -204,16 +202,14 @@ function createJob(mode, type, options) {
204202
hash, mgf1Hash, hashAlgorithm, mgf1HashAlgorithm, saltLength
205203
} = options;
206204

207-
const pendingDeprecation = getOptionValue('--pending-deprecation');
208-
209205
if (saltLength !== undefined)
210206
validateInt32(saltLength, 'options.saltLength', 0);
211207
if (hashAlgorithm !== undefined)
212208
validateString(hashAlgorithm, 'options.hashAlgorithm');
213209
if (mgf1HashAlgorithm !== undefined)
214210
validateString(mgf1HashAlgorithm, 'options.mgf1HashAlgorithm');
215211
if (hash !== undefined) {
216-
pendingDeprecation && process.emitWarning(
212+
process.emitWarning(
217213
'"options.hash" is deprecated, ' +
218214
'use "options.hashAlgorithm" instead.',
219215
'DeprecationWarning',
@@ -224,7 +220,7 @@ function createJob(mode, type, options) {
224220
}
225221
}
226222
if (mgf1Hash !== undefined) {
227-
pendingDeprecation && process.emitWarning(
223+
process.emitWarning(
228224
'"options.mgf1Hash" is deprecated, ' +
229225
'use "options.mgf1HashAlgorithm" instead.',
230226
'DeprecationWarning',

test/parallel/test-crypto-keygen-deprecation.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Flags: --pending-deprecation
2-
31
'use strict';
42

53
const common = require('../common');

0 commit comments

Comments
 (0)