| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ce546e4 commit c3b9868
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3202,6 +3202,9 @@ option, or a non-nullish non-boolean value for `verbatim` option in | |||
| 3202 | 3202 | ||
| 3203 | 3203 | <!-- YAML | |
| 3204 | 3204 | changes: | |
| 3205 | + - version: REPLACEME | ||
| 3206 | + pr-url: https://github.com/nodejs/node/pull/58706 | ||
| 3207 | + description: End-of-Life. | ||
| 3205 | 3208 | - version: v20.0.0 | |
| 3206 | 3209 | pr-url: https://github.com/nodejs/node/pull/45653 | |
| 3207 | 3210 | description: Runtime deprecation. | |
@@ -3210,10 +3213,9 @@ changes: | |||
| 3210 | 3213 | description: Documentation-only deprecation. | |
| 3211 | 3214 | --> | |
| 3212 | 3215 | ||
| 3213 | - Type: Runtime | ||
| 3216 | + Type: End-of-Life | ||
| 3214 | 3217 | ||
| 3215 | - The `'hash'` and `'mgf1Hash'` options are replaced with `'hashAlgorithm'` | ||
| 3216 | - and `'mgf1HashAlgorithm'`. | ||
| 3218 | + Use `'hashAlgorithm'` instead of `'hash'`, and `'mgf1HashAlgorithm'` instead of `'mgf1Hash'`. | ||
| 3217 | 3219 | ||
| 3218 | 3220 | ### DEP0155: Trailing slashes in pattern specifier resolutions | |
| 3219 | 3221 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -195,7 +195,7 @@ function createJob(mode, type, options) { | |||
| 195 | 195 | } | |
| 196 | 196 | ||
| 197 | 197 | const { | |
| 198 | - hash, mgf1Hash, hashAlgorithm, mgf1HashAlgorithm, saltLength, | ||
| 198 | + hashAlgorithm, mgf1HashAlgorithm, saltLength, | ||
| 199 | 199 | } = options; | |
| 200 | 200 | ||
| 201 | 201 | if (saltLength !== undefined) | |
@@ -204,36 +204,36 @@ function createJob(mode, type, options) { | |||
| 204 | 204 | validateString(hashAlgorithm, 'options.hashAlgorithm'); | |
| 205 | 205 | if (mgf1HashAlgorithm !== undefined) | |
| 206 | 206 | validateString(mgf1HashAlgorithm, 'options.mgf1HashAlgorithm'); | |
| 207 | - if (hash !== undefined) { | ||
| 208 | - process.emitWarning( | ||
| 209 | - '"options.hash" is deprecated, ' + | ||
| 210 | - 'use "options.hashAlgorithm" instead.', | ||
| 211 | - 'DeprecationWarning', | ||
| 212 | - 'DEP0154'); | ||
| 213 | - validateString(hash, 'options.hash'); | ||
| 214 | - if (hashAlgorithm && hash !== hashAlgorithm) { | ||
| 215 | - throw new ERR_INVALID_ARG_VALUE('options.hash', hash); | ||
| 216 | - } | ||
| 207 | + if (options.hash !== undefined) { | ||
| 208 | + // This API previously accepted a `hash` option that was deprecated | ||
| 209 | + // and removed. However, in order to make the change more visible, we | ||
| 210 | + // opted to throw an error if hash is specified rather than removing it | ||
| 211 | + // entirely. | ||
| 212 | + throw new ERR_INVALID_ARG_VALUE( | ||
| 213 | + 'options.hash', | ||
| 214 | + options.hash, | ||
| 215 | + 'is no longer supported', | ||
| 216 | + ); | ||
| 217 | 217 | } | |
| 218 | - if (mgf1Hash !== undefined) { | ||
| 219 | - process.emitWarning( | ||
| 220 | - '"options.mgf1Hash" is deprecated, ' + | ||
| 221 | - 'use "options.mgf1HashAlgorithm" instead.', | ||
| 222 | - 'DeprecationWarning', | ||
| 223 | - 'DEP0154'); | ||
| 224 | - validateString(mgf1Hash, 'options.mgf1Hash'); | ||
| 225 | - if (mgf1HashAlgorithm && mgf1Hash !== mgf1HashAlgorithm) { | ||
| 226 | - throw new ERR_INVALID_ARG_VALUE('options.mgf1Hash', mgf1Hash); | ||
| 227 | - } | ||
| 218 | + if (options.mgf1Hash !== undefined) { | ||
| 219 | + // This API previously accepted a `mgf1Hash` option that was deprecated | ||
| 220 | + // and removed. However, in order to make the change more visible, we | ||
| 221 | + // opted to throw an error if mgf1Hash is specified rather than removing | ||
| 222 | + // it entirely. | ||
| 223 | + throw new ERR_INVALID_ARG_VALUE( | ||
| 224 | + 'options.mgf1Hash', | ||
| 225 | + options.mgf1Hash, | ||
| 226 | + 'is no longer supported', | ||
| 227 | + ); | ||
| 228 | 228 | } | |
| 229 | 229 | ||
| 230 | 230 | return new RsaKeyPairGenJob( | |
| 231 | 231 | mode, | |
| 232 | 232 | kKeyVariantRSA_PSS, | |
| 233 | 233 | modulusLength, | |
| 234 | 234 | publicExponent, | |
| 235 | - hashAlgorithm || hash, | ||
| 236 | - mgf1HashAlgorithm || mgf1Hash, | ||
| 235 | + hashAlgorithm, | ||
| 236 | + mgf1HashAlgorithm, | ||
| 237 | 237 | saltLength, | |
| 238 | 238 | ...encoding); | |
| 239 | 239 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -800,22 +800,3 @@ const { hasOpenSSL3 } = require('../common/crypto'); | |||
| 800 | 800 | message: 'Invalid MGF1 digest: sha2' | |
| 801 | 801 | }); | |
| 802 | 802 | } | |
| 803 | - | ||
| 804 | - { | ||
| 805 | - // This test makes sure deprecated and new options must | ||
| 806 | - // be the same value. | ||
| 807 | - | ||
| 808 | - assert.throws(() => generateKeyPair('rsa-pss', { | ||
| 809 | - modulusLength: 512, | ||
| 810 | - saltLength: 16, | ||
| 811 | - mgf1Hash: 'sha256', | ||
| 812 | - mgf1HashAlgorithm: 'sha1' | ||
| 813 | - }, common.mustNotCall()), { code: 'ERR_INVALID_ARG_VALUE' }); | ||
| 814 | - | ||
| 815 | - assert.throws(() => generateKeyPair('rsa-pss', { | ||
| 816 | - modulusLength: 512, | ||
| 817 | - saltLength: 16, | ||
| 818 | - hash: 'sha256', | ||
| 819 | - hashAlgorithm: 'sha1' | ||
| 820 | - }, common.mustNotCall()), { code: 'ERR_INVALID_ARG_VALUE' }); | ||
| 821 | - } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments