diff options
author | Stefan Budeanu <stefan@budeanu.com> | 2015-11-09 00:00:56 -0500 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2015-11-20 09:35:58 -0800 |
commit | 56a2b9a24680841c5abe5660764fde06e01bdddc (patch) | |
tree | b36ac697df526b8c12ed8e3719a2b4d5ff9cc479 /test/parallel/test-crypto-dh.js | |
parent | 6de82c69a00a1515dbf4019c4f27bb1f82c508e0 (diff) | |
download | android-node-v8-56a2b9a24680841c5abe5660764fde06e01bdddc.tar.gz android-node-v8-56a2b9a24680841c5abe5660764fde06e01bdddc.tar.bz2 android-node-v8-56a2b9a24680841c5abe5660764fde06e01bdddc.zip |
crypto: disable crypto.createCipher in FIPS mode
FIPS 140-2 disallows use of MD5, which is used to derive the
initialization vector and key for createCipher(). Modify
all tests to expect exceptions in FIPS mode when disallowed
API is used, or to avoid testing such API in FIPS Mode.
PR-URL: https://github.com/nodejs/node/pull/3754
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-crypto-dh.js')
-rw-r--r-- | test/parallel/test-crypto-dh.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js index 322b5d1c70..f3e54c46a8 100644 --- a/test/parallel/test-crypto-dh.js +++ b/test/parallel/test-crypto-dh.js @@ -58,7 +58,7 @@ assert.equal(secret1, secret3); // Run this one twice to make sure that the dh3 clears its error properly (function() { - var c = crypto.createDecipher('aes-128-ecb', ''); + var c = crypto.createDecipheriv('aes-128-ecb', crypto.randomBytes(16), ''); assert.throws(function() { c.final('utf8'); }, /wrong final block length/); })(); @@ -67,7 +67,7 @@ assert.throws(function() { }, /key is too small/i); (function() { - var c = crypto.createDecipher('aes-128-ecb', ''); + var c = crypto.createDecipheriv('aes-128-ecb', crypto.randomBytes(16), ''); assert.throws(function() { c.final('utf8'); }, /wrong final block length/); })(); |