From 0be25bba09c97688b5852b87b24da3cb22fedf66 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 29 Oct 2017 11:27:55 +0100 Subject: [PATCH] test: add regression test for counter mode warning The previous commit is a back-port of pull request #13821 to v6.x. Its regression test does not apply to the v6.x branch (depends on semver-major pull request #9405) so this commit adds a new test. Refs: https://github.com/nodejs/node/pull/13821 Refs: https://github.com/nodejs/node/pull/9405 --- test/parallel/test-crypto-cipher-decipher.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js index 8b1b0051d34962..6b2df3d81fd893 100644 --- a/test/parallel/test-crypto-cipher-decipher.js +++ b/test/parallel/test-crypto-cipher-decipher.js @@ -148,3 +148,7 @@ testCipher2(Buffer.from('0123456789abcdef')); assert.strictEqual(decipher.setAuthTag(tagbuf), decipher); assert.strictEqual(decipher.setAAD(aadbuf), decipher); } + +// https://github.com/nodejs/node/issues/13801 +common.expectWarning('Warning', 'Use Cipheriv for counter mode of aes-256-gcm'); +crypto.createCipher('aes-256-gcm', '0123456789');