diff options
author | Tobias Nießen <tniessen@tnie.de> | 2018-08-02 15:23:09 +0200 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2018-08-05 23:17:20 +0200 |
commit | 933d8eb689bb4bc412e71c0069bf9b7b24de4f9d (patch) | |
tree | 14929c9e978353b3fe182e168e17a8d1a5ac3671 /test | |
parent | 28c70ac13133ed068058bbeec09dfd6770d0d151 (diff) | |
download | android-node-v8-933d8eb689bb4bc412e71c0069bf9b7b24de4f9d.tar.gz android-node-v8-933d8eb689bb4bc412e71c0069bf9b7b24de4f9d.tar.bz2 android-node-v8-933d8eb689bb4bc412e71c0069bf9b7b24de4f9d.zip |
crypto: move createCipher to runtime deprecation
PR-URL: https://github.com/nodejs/node/pull/22089
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Yihong Wang <yh.wang@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-crypto-authenticated.js | 6 | ||||
-rw-r--r-- | test/parallel/test-crypto-cipher-decipher.js | 13 | ||||
-rw-r--r-- | test/parallel/test-process-emit-warning-from-native.js | 11 |
3 files changed, 21 insertions, 9 deletions
diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js index f559327229..c7e89d6244 100644 --- a/test/parallel/test-crypto-authenticated.js +++ b/test/parallel/test-crypto-authenticated.js @@ -71,8 +71,10 @@ const expectedWarnings = common.hasFipsCrypto ? ['Use Cipheriv for counter mode of aes-256-ccm', common.noWarnCode] ]; -const expectedDeprecationWarnings = ['crypto.DEFAULT_ENCODING is deprecated.', - 'DEP0091']; +const expectedDeprecationWarnings = [ + ['crypto.DEFAULT_ENCODING is deprecated.', 'DEP0091'], + ['crypto.createCipher is deprecated.', 'DEP0106'] +]; common.expectWarning({ Warning: expectedWarnings, diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js index 89d070aaa8..81c5f32d49 100644 --- a/test/parallel/test-crypto-cipher-decipher.js +++ b/test/parallel/test-crypto-cipher-decipher.js @@ -10,6 +10,15 @@ if (common.hasFipsCrypto) const crypto = require('crypto'); const assert = require('assert'); +common.expectWarning({ + Warning: [ + ['Use Cipheriv for counter mode of aes-256-gcm', common.noWarnCode] + ], + DeprecationWarning: [ + ['crypto.createCipher is deprecated.', 'DEP0106'] + ] +}); + function testCipher1(key) { // Test encryption and decryption const plaintext = 'Keep this a secret? No! Tell everyone about node.js!'; @@ -235,10 +244,6 @@ testCipher2(Buffer.from('0123456789abcdef')); const aadbuf = Buffer.from('aadbuf'); const data = Buffer.from('test-crypto-cipher-decipher'); - common.expectWarning('Warning', - 'Use Cipheriv for counter mode of aes-256-gcm', - common.noWarnCode); - const cipher = crypto.createCipher('aes-256-gcm', key); cipher.setAAD(aadbuf); cipher.setAutoPadding(); diff --git a/test/parallel/test-process-emit-warning-from-native.js b/test/parallel/test-process-emit-warning-from-native.js index d3e2454ada..530b7a2404 100644 --- a/test/parallel/test-process-emit-warning-from-native.js +++ b/test/parallel/test-process-emit-warning-from-native.js @@ -11,9 +11,14 @@ const crypto = require('crypto'); const key = '0123456789'; { - common.expectWarning('Warning', - 'Use Cipheriv for counter mode of aes-256-gcm', - common.noWarnCode); + common.expectWarning({ + DeprecationWarning: [ + ['crypto.createCipher is deprecated.', 'DEP0106'] + ], + Warning: [ + ['Use Cipheriv for counter mode of aes-256-gcm', common.noWarnCode] + ] + }); // Emits regular warning expected by expectWarning() crypto.createCipher('aes-256-gcm', key); |