Skip to content

Commit

Permalink
crypto: remove deprecated crypto._toBuf
Browse files Browse the repository at this point in the history
PR-URL: nodejs#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]>
  • Loading branch information
tniessen authored and refack committed Jan 10, 2019
1 parent 548e94c commit fea4525
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
7 changes: 5 additions & 2 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2167,15 +2167,18 @@ release.
### DEP0114: crypto._toBuf()
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/???
description: End-of-Life.
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/22501
description: Runtime deprecation.
-->
Type: Runtime
Type: End-Of-Life
The `crypto._toBuf()` function was not designed to be used by modules outside
of Node.js core and will be removed in the future.
of Node.js core and was removed.
<a id="DEP0115"></a>
### DEP0115: crypto.prng(), crypto.pseudoRandomBytes(), crypto.rng()
Expand Down
7 changes: 1 addition & 6 deletions lib/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ const {
getHashes,
setDefaultEncoding,
setEngine,
timingSafeEqual,
toBuf
timingSafeEqual
} = require('internal/crypto/util');
const Certificate = require('internal/crypto/certificate');

Expand Down Expand Up @@ -216,10 +215,6 @@ function getFipsForced() {
}

Object.defineProperties(exports, {
_toBuf: {
enumerable: false,
value: deprecate(toBuf, 'crypto._toBuf is deprecated.', 'DEP0114')
},
createCipher: {
enumerable: false,
value: deprecate(createCipher,
Expand Down
8 changes: 1 addition & 7 deletions test/parallel/test-crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ if (!common.hasCrypto)

common.expectWarning({
DeprecationWarning: [
['crypto.createCipher is deprecated.', 'DEP0106'],
['crypto._toBuf is deprecated.', 'DEP0114']
['crypto.createCipher is deprecated.', 'DEP0106']
]
});

Expand Down Expand Up @@ -301,8 +300,3 @@ testEncoding({
testEncoding({
defaultEncoding: 'latin1'
}, assertionHashLatin1);

{
// Test that the exported _toBuf function is deprecated.
crypto._toBuf(Buffer.alloc(0));
}

0 comments on commit fea4525

Please sign in to comment.