From fea45251abd4329a2b2b00a67e674ee833f9af54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Fri, 4 Jan 2019 13:35:00 +0100 Subject: [PATCH] crypto: remove deprecated crypto._toBuf PR-URL: https://github.com/nodejs/node/pull/25338 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Minwoo Jung Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis --- doc/api/deprecations.md | 7 +++++-- lib/crypto.js | 7 +------ test/parallel/test-crypto.js | 8 +------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 547d0e32bca958..215c4767c40a08 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2167,15 +2167,18 @@ release. ### DEP0114: crypto._toBuf() -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. ### DEP0115: crypto.prng(), crypto.pseudoRandomBytes(), crypto.rng() diff --git a/lib/crypto.js b/lib/crypto.js index a0062a3d530f62..97a9b14bc8afd6 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -94,8 +94,7 @@ const { getHashes, setDefaultEncoding, setEngine, - timingSafeEqual, - toBuf + timingSafeEqual } = require('internal/crypto/util'); const Certificate = require('internal/crypto/certificate'); @@ -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, diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js index 8bbc1cff80597e..73b81ec1b10149 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -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'] ] }); @@ -301,8 +300,3 @@ testEncoding({ testEncoding({ defaultEncoding: 'latin1' }, assertionHashLatin1); - -{ - // Test that the exported _toBuf function is deprecated. - crypto._toBuf(Buffer.alloc(0)); -}