[PATCH 2/2] test: Skip shake* tests on OpenSSL 3.4
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Tue, 31 Dec 2024 16:23:35 +0000 (17:23 +0100)
committerJérémy Lal <kapouer@melix.org>
Wed, 1 Jan 2025 13:34:52 +0000 (14:34 +0100)
shake* requires a length to be set.
Skip the tests for now.

=> https://github.com/nodejs/node/issues/56159
=> https://github.com/openssl/openssl/commit/b911fef216d1386210ec24e201d54d709528abb4

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Gbp-Pq: Topic build
Gbp-Pq: Name openssl-3.4-skip-shake-tests.patch

test/parallel/test-crypto-hash.js
test/parallel/test-crypto-oneshot-hash.js

index af2146982c7a3bf7bd7527f44e4b17a3b605026e..aa29d8df20c50ba21ee336f5ed982ae1ed936f13 100644 (file)
@@ -182,6 +182,8 @@ assert.throws(
 
 // Test XOF hash functions and the outputLength option.
 {
+  // Skip shake XOF due to length requirement.
+  if (!common.hasOpenSSL34) {
   // Default outputLengths.
   assert.strictEqual(crypto.createHash('shake128').digest('hex'),
                      '7f9c2ba4e88f827d616045507605853e');
@@ -195,6 +197,7 @@ assert.throws(
                            .digest('hex'),
                      '46b9dd2b0ba88d13233b3feb743eeb24' +
                      '3fcd52ea62b81b82b50c27646ed5762f');
+  }
 
   // Short outputLengths.
   assert.strictEqual(crypto.createHash('shake128', { outputLength: 0 })
index 56b4c04a65a1c1d15b79b166c061496d5a3c4748..3a2571ae007678875958ea9716354c79d2cabd04 100644 (file)
@@ -31,6 +31,9 @@ const methods = crypto.getHashes();
 const input = fs.readFileSync(fixtures.path('utf8_test_text.txt'));
 
 for (const method of methods) {
+  // Skip shake XOF due to length requirement.
+  if (common.hasOpenSSL34 && (method === 'shake128') || (method === 'shake256'))
+  continue;
   for (const outputEncoding of ['buffer', 'hex', 'base64', undefined]) {
     const oldDigest = crypto.createHash(method).update(input).digest(outputEncoding || 'hex');
     const digestFromBuffer = crypto.hash(method, input, outputEncoding);