Skip to content

Commit bf3cb3f

Browse files
tniessenaddaleax
authored andcommitted
crypto: remove deprecated crypto._toBuf
PR-URL: #25338 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 3255ae4 commit bf3cb3f

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

doc/api/deprecations.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -2167,15 +2167,18 @@ release.
21672167
### DEP0114: crypto._toBuf()
21682168
<!-- YAML
21692169
changes:
2170+
- version: REPLACEME
2171+
pr-url: https://github.com/nodejs/node/pull/???
2172+
description: End-of-Life.
21702173
- version: v11.0.0
21712174
pr-url: https://github.com/nodejs/node/pull/22501
21722175
description: Runtime deprecation.
21732176
-->
21742177
2175-
Type: Runtime
2178+
Type: End-Of-Life
21762179
21772180
The `crypto._toBuf()` function was not designed to be used by modules outside
2178-
of Node.js core and will be removed in the future.
2181+
of Node.js core and was removed.
21792182
21802183
<a id="DEP0115"></a>
21812184
### DEP0115: crypto.prng(), crypto.pseudoRandomBytes(), crypto.rng()

lib/crypto.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ const {
9494
getHashes,
9595
setDefaultEncoding,
9696
setEngine,
97-
timingSafeEqual,
98-
toBuf
97+
timingSafeEqual
9998
} = require('internal/crypto/util');
10099
const Certificate = require('internal/crypto/certificate');
101100

@@ -216,10 +215,6 @@ function getFipsForced() {
216215
}
217216

218217
Object.defineProperties(exports, {
219-
_toBuf: {
220-
enumerable: false,
221-
value: deprecate(toBuf, 'crypto._toBuf is deprecated.', 'DEP0114')
222-
},
223218
createCipher: {
224219
enumerable: false,
225220
value: deprecate(createCipher,

test/parallel/test-crypto.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ if (!common.hasCrypto)
2727

2828
common.expectWarning({
2929
DeprecationWarning: [
30-
['crypto.createCipher is deprecated.', 'DEP0106'],
31-
['crypto._toBuf is deprecated.', 'DEP0114']
30+
['crypto.createCipher is deprecated.', 'DEP0106']
3231
]
3332
});
3433

@@ -301,8 +300,3 @@ testEncoding({
301300
testEncoding({
302301
defaultEncoding: 'latin1'
303302
}, assertionHashLatin1);
304-
305-
{
306-
// Test that the exported _toBuf function is deprecated.
307-
crypto._toBuf(Buffer.alloc(0));
308-
}

0 commit comments

Comments
 (0)