From 4b90576e5ea181f918dde9b01f7260cec8061aa5 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sat, 23 Sep 2017 00:16:52 -0400 Subject: [PATCH] test: remove sha from test expectations "sha" in OpenSSL refers to SHA-0 which was removed from OpenSSL 1.1.0 and is insecure. Replace it with SHA-256 which is present in both 1.0.2 and 1.1.0. Short of shipping a reimplementation in Node, this is an unavoidable behavior change with 1.1.0. PR-URL: https://github.com/nodejs/node/pull/16130 Backport-PR-URL: https://github.com/nodejs/node/pull/18622 Reviewed-By: Ben Noordhuis Reviewed-By: Rod Vagg --- test/parallel/test-crypto.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js index d605d97abd4fee..3b38fd47ad686e 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -129,12 +129,12 @@ const noCapitals = /^[^A-Z]+$/; assert(tlsCiphers.every((value) => noCapitals.test(value))); validateList(tlsCiphers); -// Assert that we have sha and sha1 but not SHA and SHA1. +// Assert that we have sha1 and sha256 but not SHA1 and SHA256. assert.notStrictEqual(0, crypto.getHashes().length); assert(crypto.getHashes().includes('sha1')); -assert(crypto.getHashes().includes('sha')); +assert(crypto.getHashes().includes('sha256')); assert(!crypto.getHashes().includes('SHA1')); -assert(!crypto.getHashes().includes('SHA')); +assert(!crypto.getHashes().includes('SHA256')); assert(crypto.getHashes().includes('RSA-SHA1')); assert(!crypto.getHashes().includes('rsa-sha1')); validateList(crypto.getHashes());