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>
This commit is contained in:
parent
317c2e13a3
commit
c521a20f43
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -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
|
||||
|
||||
|
@ -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');
|
||||
|
@ -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';
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 = {
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user