diff options
author | Tobias Nießen <tniessen@tnie.de> | 2019-03-30 11:01:45 +0100 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2019-04-04 16:45:41 +0200 |
commit | 2f1ed5c0637a7bdd079136d2cb80f6a4184ae299 (patch) | |
tree | 79ddc4ec3418c4e57d0dd1ca1c33c8c3779273af /lib/internal/crypto | |
parent | 73bca57988c847a4b17b923686eee8e04e4fa13c (diff) | |
download | android-node-v8-2f1ed5c0637a7bdd079136d2cb80f6a4184ae299.tar.gz android-node-v8-2f1ed5c0637a7bdd079136d2cb80f6a4184ae299.tar.bz2 android-node-v8-2f1ed5c0637a7bdd079136d2cb80f6a4184ae299.zip |
crypto: remove legacy native handles
PR-URL: https://github.com/nodejs/node/pull/27011
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib/internal/crypto')
-rw-r--r-- | lib/internal/crypto/cipher.js | 6 | ||||
-rw-r--r-- | lib/internal/crypto/diffiehellman.js | 6 | ||||
-rw-r--r-- | lib/internal/crypto/hash.js | 5 | ||||
-rw-r--r-- | lib/internal/crypto/sig.js | 5 | ||||
-rw-r--r-- | lib/internal/crypto/util.js | 14 |
5 files changed, 0 insertions, 36 deletions
diff --git a/lib/internal/crypto/cipher.js b/lib/internal/crypto/cipher.js index dd6fe2d6d7..28bd1e57a6 100644 --- a/lib/internal/crypto/cipher.js +++ b/lib/internal/crypto/cipher.js @@ -20,7 +20,6 @@ const { const { getDefaultEncoding, kHandle, - legacyNativeHandle, toBuf } = require('internal/crypto/util'); @@ -219,8 +218,6 @@ Cipher.prototype.setAAD = function setAAD(aadbuf, options) { return this; }; -legacyNativeHandle(Cipher); - function Cipheriv(cipher, key, iv, options) { if (!(this instanceof Cipheriv)) return new Cipheriv(cipher, key, iv, options); @@ -245,7 +242,6 @@ function addCipherPrototypeFunctions(constructor) { Object.setPrototypeOf(Cipheriv.prototype, LazyTransform.prototype); Object.setPrototypeOf(Cipheriv, LazyTransform); addCipherPrototypeFunctions(Cipheriv); -legacyNativeHandle(Cipheriv); function Decipher(cipher, password, options) { if (!(this instanceof Decipher)) @@ -257,7 +253,6 @@ function Decipher(cipher, password, options) { Object.setPrototypeOf(Decipher.prototype, LazyTransform.prototype); Object.setPrototypeOf(Decipher, LazyTransform); addCipherPrototypeFunctions(Decipher); -legacyNativeHandle(Decipher); function Decipheriv(cipher, key, iv, options) { @@ -270,7 +265,6 @@ function Decipheriv(cipher, key, iv, options) { Object.setPrototypeOf(Decipheriv.prototype, LazyTransform.prototype); Object.setPrototypeOf(Decipheriv, LazyTransform); addCipherPrototypeFunctions(Decipheriv); -legacyNativeHandle(Decipheriv); module.exports = { Cipher, diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js index 3bfc531455..7ec2ce6e41 100644 --- a/lib/internal/crypto/diffiehellman.js +++ b/lib/internal/crypto/diffiehellman.js @@ -11,7 +11,6 @@ const { isArrayBufferView } = require('internal/util/types'); const { getDefaultEncoding, kHandle, - legacyNativeHandle, toBuf } = require('internal/crypto/util'); const { @@ -165,9 +164,6 @@ DiffieHellman.prototype.setPrivateKey = function setPrivateKey(key, encoding) { return this; }; -legacyNativeHandle(DiffieHellman); -legacyNativeHandle(DiffieHellmanGroup); - function ECDH(curve) { if (!(this instanceof ECDH)) @@ -195,8 +191,6 @@ ECDH.prototype.getPublicKey = function getPublicKey(encoding, format) { return encode(key, encoding); }; -legacyNativeHandle(ECDH); - ECDH.convertKey = function convertKey(key, curve, inEnc, outEnc, format) { if (typeof key !== 'string' && !isArrayBufferView(key)) { throw new ERR_INVALID_ARG_TYPE( diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index 5e67efe6c5..89ab29d845 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -8,7 +8,6 @@ const { const { getDefaultEncoding, kHandle, - legacyNativeHandle, toBuf } = require('internal/crypto/util'); @@ -89,8 +88,6 @@ Hash.prototype.digest = function digest(outputEncoding) { return ret; }; -legacyNativeHandle(Hash); - function Hmac(hmac, key, options) { if (!(this instanceof Hmac)) @@ -130,8 +127,6 @@ Hmac.prototype.digest = function digest(outputEncoding) { Hmac.prototype._flush = Hash.prototype._flush; Hmac.prototype._transform = Hash.prototype._transform; -legacyNativeHandle(Hmac); - module.exports = { Hash, Hmac diff --git a/lib/internal/crypto/sig.js b/lib/internal/crypto/sig.js index 6ecc64c3d4..2dbebcdd80 100644 --- a/lib/internal/crypto/sig.js +++ b/lib/internal/crypto/sig.js @@ -19,7 +19,6 @@ const { const { getDefaultEncoding, kHandle, - legacyNativeHandle, toBuf, validateArrayBufferView, } = require('internal/crypto/util'); @@ -56,8 +55,6 @@ Sign.prototype.update = function update(data, encoding) { return this; }; -legacyNativeHandle(Sign); - function getPadding(options) { return getIntOption('padding', RSA_PKCS1_PADDING, options); } @@ -166,8 +163,6 @@ Verify.prototype.verify = function verify(options, signature, sigEncoding) { rsaPadding, pssSaltLength); }; -legacyNativeHandle(Verify); - function verifyOneShot(algorithm, data, key, signature) { if (algorithm != null) validateString(algorithm, 'algorithm'); diff --git a/lib/internal/crypto/util.js b/lib/internal/crypto/util.js index c8a1f9e927..ddef1a163c 100644 --- a/lib/internal/crypto/util.js +++ b/lib/internal/crypto/util.js @@ -21,7 +21,6 @@ const { validateString } = require('internal/validators'); const { Buffer } = require('buffer'); const { cachedResult, - deprecate, filterDuplicateStrings } = require('internal/util'); const { @@ -30,18 +29,6 @@ const { const kHandle = Symbol('kHandle'); -function legacyNativeHandle(clazz) { - Object.defineProperty(clazz.prototype, '_handle', { - get: deprecate(function() { return this[kHandle]; }, - `${clazz.name}._handle is deprecated. Use the public API ` + - 'instead.', 'DEP0117'), - set: deprecate(function(h) { this[kHandle] = h; }, - `${clazz.name}._handle is deprecated. Use the public API ` + - 'instead.', 'DEP0117'), - enumerable: false - }); -} - var defaultEncoding = 'buffer'; function setDefaultEncoding(val) { @@ -116,7 +103,6 @@ module.exports = { getDefaultEncoding, getHashes, kHandle, - legacyNativeHandle, setDefaultEncoding, setEngine, timingSafeEqual, |