From 08af023b1f8e34cfe9f96fb6f9a2e3ba04ef0510 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Wed, 30 Nov 2022 22:14:33 +0100 Subject: [PATCH] crypto: runtime deprecate replaced rsa-pss keygen parameters PR-URL: https://github.com/nodejs/node/pull/45653 Reviewed-By: Antoine du Hamel Reviewed-By: Yagiz Nizipli Reviewed-By: Minwoo Jung Reviewed-By: Rich Trott --- doc/api/deprecations.md | 5 ++++- lib/internal/crypto/keygen.js | 8 ++------ test/parallel/test-crypto-keygen-deprecation.js | 2 -- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index c628ebd0846890..a0ddcf40acc445 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2973,12 +2973,15 @@ option, or a non-nullish non-boolean value for `verbatim` option in -Type: Documentation-only (supports [`--pending-deprecation`][]) +Type: Runtime The `'hash'` and `'mgf1Hash'` options are replaced with `'hashAlgorithm'` and `'mgf1HashAlgorithm'`. diff --git a/lib/internal/crypto/keygen.js b/lib/internal/crypto/keygen.js index 05b1150a203b75..cbb4177fc8c013 100644 --- a/lib/internal/crypto/keygen.js +++ b/lib/internal/crypto/keygen.js @@ -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; } @@ -204,8 +202,6 @@ 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) @@ -213,7 +209,7 @@ function createJob(mode, type, options) { if (mgf1HashAlgorithm !== undefined) validateString(mgf1HashAlgorithm, 'options.mgf1HashAlgorithm'); if (hash !== undefined) { - pendingDeprecation && process.emitWarning( + process.emitWarning( '"options.hash" is deprecated, ' + 'use "options.hashAlgorithm" instead.', 'DeprecationWarning', @@ -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', diff --git a/test/parallel/test-crypto-keygen-deprecation.js b/test/parallel/test-crypto-keygen-deprecation.js index 318377e840b0fc..926dfbbc4ae987 100644 --- a/test/parallel/test-crypto-keygen-deprecation.js +++ b/test/parallel/test-crypto-keygen-deprecation.js @@ -1,5 +1,3 @@ -// Flags: --pending-deprecation - 'use strict'; const common = require('../common');