From 1b257c9042f2867524c41191dd17ca47c2c84c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 21 Feb 2019 20:52:45 +0100 Subject: [PATCH 1/3] crypto: move DEP0113 to End-of-Life --- doc/api/deprecations.md | 11 ++++++----- lib/internal/crypto/cipher.js | 21 +-------------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 169b5a51315465..6332fb87875b5f 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2162,17 +2162,18 @@ accessed outside of Node.js core: `Socket.prototype._handle`, ### DEP0113: Cipher.setAuthTag(), Decipher.getAuthTag() -Type: Runtime +Type: End-of-Life -With the current crypto API, having `Cipher.setAuthTag()` and -`Decipher.getAuthTag()` is not helpful and both functions will throw an error -when called. They have never been documented and will be removed in a future -release. +The functions `Cipher.setAuthTag()` and `Decipher.getAuthTag()` have been +removed. They had never been documented would throw when called. ### DEP0114: crypto._toBuf() diff --git a/lib/internal/crypto/cipher.js b/lib/internal/crypto/cipher.js index a2ede771ac3fa0..dd6fe2d6d7139a 100644 --- a/lib/internal/crypto/cipher.js +++ b/lib/internal/crypto/cipher.js @@ -37,7 +37,7 @@ const { const assert = require('internal/assert'); const LazyTransform = require('internal/streams/lazy_transform'); -const { deprecate, normalizeEncoding } = require('internal/util'); +const { normalizeEncoding } = require('internal/util'); // Lazy loaded for startup performance. let StringDecoder; @@ -206,13 +206,6 @@ function setAuthTag(tagbuf) { return this; } -Object.defineProperty(Cipher.prototype, 'setAuthTag', { - get: deprecate(() => setAuthTag, - 'Cipher.setAuthTag is deprecated and will be removed in a ' + - 'future version of Node.js.', - 'DEP0113') -}); - Cipher.prototype.setAAD = function setAAD(aadbuf, options) { if (!isArrayBufferView(aadbuf)) { throw new ERR_INVALID_ARG_TYPE('buffer', @@ -243,20 +236,8 @@ function addCipherPrototypeFunctions(constructor) { constructor.prototype.setAutoPadding = Cipher.prototype.setAutoPadding; if (constructor === Cipheriv) { constructor.prototype.getAuthTag = Cipher.prototype.getAuthTag; - Object.defineProperty(constructor.prototype, 'setAuthTag', { - get: deprecate(() => setAuthTag, - 'Cipher.setAuthTag is deprecated and will be removed in ' + - 'a future version of Node.js.', - 'DEP0113') - }); } else { constructor.prototype.setAuthTag = setAuthTag; - Object.defineProperty(constructor.prototype, 'getAuthTag', { - get: deprecate(() => constructor.prototype.getAuthTag, - 'Decipher.getAuthTag is deprecated and will be removed ' + - 'in a future version of Node.js.', - 'DEP0113') - }); } constructor.prototype.setAAD = Cipher.prototype.setAAD; } From d1453e50479d1eca02e51fbecf24f137ffc92510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 21 Feb 2019 22:51:16 +0100 Subject: [PATCH 2/3] fixup! crypto: move DEP0113 to End-of-Life --- doc/api/deprecations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 6332fb87875b5f..9a33fdf2075760 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2163,7 +2163,7 @@ accessed outside of Node.js core: `Socket.prototype._handle`,