aboutsummaryrefslogtreecommitdiff
path: root/test/parallel
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-04-23 12:39:14 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-04-25 06:09:21 +0200
commitc521a20f43a12368625ce9bb42b67af1572a04b8 (patch)
treea4d5e17b63775185cc872b42f453d2168ba0ffa9 /test/parallel
parent317c2e13a3b43e5bdf4f5845ec2af8f4e8d6913b (diff)
downloadandroid-node-v8-c521a20f43a12368625ce9bb42b67af1572a04b8.tar.gz
android-node-v8-c521a20f43a12368625ce9bb42b67af1572a04b8.tar.bz2
android-node-v8-c521a20f43a12368625ce9bb42b67af1572a04b8.zip
test: remove crypto.DEFAULT_ENCODING usage
This commit removes the usage of the deprectated crypto.DEFAULT_ENCODING. PR-URL: https://github.com/nodejs/node/pull/20221 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test/parallel')
-rw-r--r--test/parallel/test-crypto-binary-default.js4
-rw-r--r--test/parallel/test-crypto-certificate.js2
-rw-r--r--test/parallel/test-crypto-ecb.js2
-rw-r--r--test/parallel/test-crypto-padding-aes256.js2
-rw-r--r--test/parallel/test-crypto-padding.js2
-rw-r--r--test/parallel/test-crypto-random.js2
-rw-r--r--test/parallel/test-crypto-verify-failure.js2
-rw-r--r--test/parallel/test-crypto.js2
8 files changed, 3 insertions, 15 deletions
diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js
index 6cdc894753..228e2cc8ab 100644
--- a/test/parallel/test-crypto-binary-default.js
+++ b/test/parallel/test-crypto-binary-default.js
@@ -20,6 +20,8 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
+// Flags: --expose-internals
+
// This is the same as test/simple/test-crypto, but from before the shift
// to use buffers by default.
@@ -36,7 +38,7 @@ const tls = require('tls');
const fixtures = require('../common/fixtures');
const DH_NOT_SUITABLE_GENERATOR = crypto.constants.DH_NOT_SUITABLE_GENERATOR;
-crypto.DEFAULT_ENCODING = 'latin1';
+require('internal/crypto/util').setDefaultEncoding('latin1');
// Test Certificates
const certPem = fixtures.readSync('test_cert.pem', 'ascii');
diff --git a/test/parallel/test-crypto-certificate.js b/test/parallel/test-crypto-certificate.js
index f94c82474e..acbfdf66cc 100644
--- a/test/parallel/test-crypto-certificate.js
+++ b/test/parallel/test-crypto-certificate.js
@@ -29,8 +29,6 @@ const crypto = require('crypto');
const { Certificate } = crypto;
const fixtures = require('../common/fixtures');
-crypto.DEFAULT_ENCODING = 'buffer';
-
// Test Certificates
const spkacValid = fixtures.readSync('spkac.valid');
const spkacFail = fixtures.readSync('spkac.fail');
diff --git a/test/parallel/test-crypto-ecb.js b/test/parallel/test-crypto-ecb.js
index 4faf4af2c5..c88ebaabb0 100644
--- a/test/parallel/test-crypto-ecb.js
+++ b/test/parallel/test-crypto-ecb.js
@@ -30,8 +30,6 @@ if (common.hasFipsCrypto)
const assert = require('assert');
const crypto = require('crypto');
-crypto.DEFAULT_ENCODING = 'buffer';
-
// Testing whether EVP_CipherInit_ex is functioning correctly.
// Reference: bug#1997
diff --git a/test/parallel/test-crypto-padding-aes256.js b/test/parallel/test-crypto-padding-aes256.js
index ea31c7e894..d6c395f0a4 100644
--- a/test/parallel/test-crypto-padding-aes256.js
+++ b/test/parallel/test-crypto-padding-aes256.js
@@ -27,8 +27,6 @@ if (!common.hasCrypto)
const assert = require('assert');
const crypto = require('crypto');
-crypto.DEFAULT_ENCODING = 'buffer';
-
const iv = Buffer.from('00000000000000000000000000000000', 'hex');
const key = Buffer.from('0123456789abcdef0123456789abcdef' +
'0123456789abcdef0123456789abcdef', 'hex');
diff --git a/test/parallel/test-crypto-padding.js b/test/parallel/test-crypto-padding.js
index 00b600efb7..d4a5b95cec 100644
--- a/test/parallel/test-crypto-padding.js
+++ b/test/parallel/test-crypto-padding.js
@@ -27,8 +27,6 @@ if (!common.hasCrypto)
const assert = require('assert');
const crypto = require('crypto');
-crypto.DEFAULT_ENCODING = 'buffer';
-
// Input data.
const ODD_LENGTH_PLAIN = 'Hello node world!';
const EVEN_LENGTH_PLAIN = 'Hello node world!AbC09876dDeFgHi';
diff --git a/test/parallel/test-crypto-random.js b/test/parallel/test-crypto-random.js
index 77801f6d53..f00e474b6f 100644
--- a/test/parallel/test-crypto-random.js
+++ b/test/parallel/test-crypto-random.js
@@ -32,8 +32,6 @@ const { kMaxLength } = require('buffer');
const kMaxUint32 = Math.pow(2, 32) - 1;
const kMaxPossibleLength = Math.min(kMaxLength, kMaxUint32);
-crypto.DEFAULT_ENCODING = 'buffer';
-
// bump, we register a lot of exit listeners
process.setMaxListeners(256);
diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js
index 72dfb92641..7e9fda9f67 100644
--- a/test/parallel/test-crypto-verify-failure.js
+++ b/test/parallel/test-crypto-verify-failure.js
@@ -29,8 +29,6 @@ const crypto = require('crypto');
const tls = require('tls');
const fixtures = require('../common/fixtures');
-crypto.DEFAULT_ENCODING = 'buffer';
-
const certPem = fixtures.readSync('test_cert.pem', 'ascii');
const options = {
diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js
index 3047d37c96..9a93e8422f 100644
--- a/test/parallel/test-crypto.js
+++ b/test/parallel/test-crypto.js
@@ -30,8 +30,6 @@ const crypto = require('crypto');
const tls = require('tls');
const fixtures = require('../common/fixtures');
-crypto.DEFAULT_ENCODING = 'buffer';
-
// Test Certificates
const caPem = fixtures.readSync('test_ca.pem', 'ascii');
const certPem = fixtures.readSync('test_cert.pem', 'ascii');