Skip to content

Commit d2ee7d6

Browse files
aduh95vsemozhetbyt
authored andcommitted
crypto: remove deprecated legacy API
The `crypto.Credentials` legacy API has been Runtime deprecated since v0.11.13 and users had been adviced to use `tls.SecureContext` instead. PR-URL: #21153 Fixes: #20793 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3950a3e commit d2ee7d6

File tree

5 files changed

+4
-66
lines changed

5 files changed

+4
-66
lines changed

doc/api/crypto.md

-20
Original file line numberDiff line numberDiff line change
@@ -1415,25 +1415,6 @@ something has to be unpredictable and unique, but does not have to be secret;
14151415
it is important to remember that an attacker must not be able to predict ahead
14161416
of time what a given IV will be.
14171417

1418-
### crypto.createCredentials(details)
1419-
<!-- YAML
1420-
added: v0.1.92
1421-
deprecated: v0.11.13
1422-
-->
1423-
1424-
> Stability: 0 - Deprecated: Use [`tls.createSecureContext()`][] instead.
1425-
1426-
- `details` {Object} Identical to [`tls.createSecureContext()`][].
1427-
- Returns: {tls.SecureContext}
1428-
1429-
The `crypto.createCredentials()` method is a deprecated function for creating
1430-
and returning a `tls.SecureContext`. It should not be used. Replace it with
1431-
[`tls.createSecureContext()`][] which has the exact same arguments and return
1432-
value.
1433-
1434-
Returns a `tls.SecureContext`, as-if [`tls.createSecureContext()`][] had been
1435-
called.
1436-
14371418
### crypto.createDecipher(algorithm, password[, options])
14381419
<!-- YAML
14391420
added: v0.1.94
@@ -2750,7 +2731,6 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
27502731
[`sign.update()`]: #crypto_sign_update_data_inputencoding
27512732
[`stream.transform` options]: stream.html#stream_new_stream_transform_options
27522733
[`stream.Writable` options]: stream.html#stream_constructor_new_stream_writable_options
2753-
[`tls.createSecureContext()`]: tls.html#tls_tls_createsecurecontext_options
27542734
[`verify.update()`]: #crypto_verify_update_data_inputencoding
27552735
[`verify.verify()`]: #crypto_verify_verify_object_signature_signatureformat
27562736
[AEAD algorithms]: https://en.wikipedia.org/wiki/Authenticated_encryption

doc/api/deprecations.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,17 @@ undefined `digest` will throw a `TypeError`.
142142
<a id="DEP0010"></a>
143143
### DEP0010: crypto.createCredentials
144144

145-
Type: Runtime
145+
Type: End-of-Life
146146

147-
The [`crypto.createCredentials()`][] API is deprecated. Please use
147+
The `crypto.createCredentials()` API was removed. Please use
148148
[`tls.createSecureContext()`][] instead.
149149

150150
<a id="DEP0011"></a>
151151
### DEP0011: crypto.Credentials
152152

153-
Type: Runtime
153+
Type: End-of-Life
154154

155-
The `crypto.Credentials` class is deprecated. Please use [`tls.SecureContext`][]
155+
The `crypto.Credentials` class was removed. Please use [`tls.SecureContext`][]
156156
instead.
157157

158158
<a id="DEP0012"></a>
@@ -1020,7 +1020,6 @@ The option `produceCachedData` has been deprecated. Use
10201020
[`console.log()`]: console.html#console_console_log_data_args
10211021
[`crypto.createCipher()`]: crypto.html#crypto_crypto_createcipher_algorithm_password_options
10221022
[`crypto.createCipheriv()`]: crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options
1023-
[`crypto.createCredentials()`]: crypto.html#crypto_crypto_createcredentials_details
10241023
[`crypto.createDecipher()`]: crypto.html#crypto_crypto_createdecipher_algorithm_password_options
10251024
[`crypto.createDecipheriv()`]: crypto.html#crypto_crypto_createdecipheriv_algorithm_key_iv_options
10261025
[`crypto.DEFAULT_ENCODING`]: crypto.html#crypto_crypto_default_encoding

lib/crypto.js

-18
Original file line numberDiff line numberDiff line change
@@ -228,23 +228,5 @@ Object.defineProperties(exports, {
228228
configurable: false,
229229
enumerable: true,
230230
value: constants
231-
},
232-
233-
// Legacy API
234-
createCredentials: {
235-
configurable: true,
236-
enumerable: true,
237-
get: deprecate(() => {
238-
return require('tls').createSecureContext;
239-
}, 'crypto.createCredentials is deprecated. ' +
240-
'Use tls.createSecureContext instead.', 'DEP0010')
241-
},
242-
Credentials: {
243-
configurable: true,
244-
enumerable: true,
245-
get: deprecate(function() {
246-
return require('tls').SecureContext;
247-
}, 'crypto.Credentials is deprecated. ' +
248-
'Use tls.SecureContext instead.', 'DEP0011')
249231
}
250232
});

test/parallel/test-crypto-classes.js

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const TEST_CASES = {
1919
'DiffieHellman': [1024],
2020
'DiffieHellmanGroup': ['modp5'],
2121
'ECDH': ['prime256v1'],
22-
'Credentials': []
2322
};
2423

2524
if (!common.hasFipsCrypto) {

test/parallel/test-crypto-deprecated.js

-22
This file was deleted.

0 commit comments

Comments
 (0)