From c2039213baa4a39c623bbcc973dfd83fce730e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 20 Feb 2023 03:04:14 +0100 Subject: [PATCH] test: use newish OpenSSL feature in test-tls-dhe According to the comment that is being replaced here, this was not possible with the current version of OpenSSL 1.0.2 at the time the test was written. New OpenSSL versions appear to always print the length of the temporary key. Refs: https://github.com/nodejs/node-v0.x-archive/pull/8272 PR-URL: https://github.com/nodejs/node/pull/46708 Reviewed-By: Filip Skokan Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/parallel/test-tls-dhe.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-tls-dhe.js b/test/parallel/test-tls-dhe.js index 0d531a3d6f0179..e6eb92540ae28f 100644 --- a/test/parallel/test-tls-dhe.js +++ b/test/parallel/test-tls-dhe.js @@ -77,8 +77,8 @@ function test(keylen, expectedCipher, cb) { out += d; }); client.stdout.on('end', function() { - // DHE key length can be checked -brief option in s_client but it - // is only supported in openssl 1.0.2 so we cannot check it. + assert(keylen === 'error' || + out.includes(`Server Temp Key: DH, ${keylen} bits`)); const reg = new RegExp(`Cipher : ${expectedCipher}`); if (reg.test(out)) { nsuccess++;