Skip to content

Commit c8520ff

Browse files
committed
test: fix OpenSSL version checks
As per the original pull request that introduced the OpenSSL version check in `parallel/test-crypto-dh`: ``` Error message change is test-only and uses the right error message for versions >=3.0.12 in 3.0.x and >= 3.1.4 in 3.1.x series. ``` Fix the check so that: - The older message is expected for OpenSSL 3.1.0. - The newer message is expected for OpenSSL from 3.1.4 (e.g. 3.2.x). Refs: nodejs#50395 PR-URL: nodejs#53503 Refs: nodejs#53382 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 9824827 commit c8520ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/parallel/test-crypto-dh.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ const crypto = require('crypto');
8686
}
8787

8888
{
89-
const hasOpenSSL3WithNewErrorMessage = (common.hasOpenSSL(3, 0, 12) && !common.hasOpenSSL(3, 1, 1)) ||
90-
(common.hasOpenSSL(3, 1, 4) && !common.hasOpenSSL(3, 2, 1));
89+
// Error message was changed in OpenSSL 3.0.x from 3.0.12, and 3.1.x from 3.1.4.
90+
const hasOpenSSL3WithNewErrorMessage = (common.hasOpenSSL(3, 0, 12) && !common.hasOpenSSL(3, 1, 0)) ||
91+
(common.hasOpenSSL(3, 1, 4));
9192
assert.throws(() => {
9293
dh3.computeSecret('');
9394
}, { message: common.hasOpenSSL3 && !hasOpenSSL3WithNewErrorMessage ?

0 commit comments

Comments
 (0)