Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9bf7604

Browse filesBrowse files
panvaaduh95
authored andcommitted
test: skip tls-deprecated secp256k1 on OpenSSL 4.0
Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: #62805 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent d173604 commit 9bf7604
Copy full SHA for 9bf7604

1 file changed

+13-2Lines changed: 13 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-tls-ecdh-multiple.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-ecdh-multiple.js
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (!common.hasCrypto) {
88
common.skip('missing crypto');
99
}
1010

11-
const { opensslCli } = require('../common/crypto');
11+
const { opensslCli, hasOpenSSL } = require('../common/crypto');
1212
const crypto = require('crypto');
1313

1414
if (!opensslCli) {
@@ -24,11 +24,17 @@ function loadPEM(n) {
2424
return fixtures.readKey(`${n}.pem`);
2525
}
2626

27+
// OpenSSL 4.0 disables support for deprecated elliptic curves from RFC 8422
28+
// (including secp256k1) by default.
29+
const ecdhCurve = hasOpenSSL(4, 0) ?
30+
'prime256v1:secp521r1' :
31+
'secp256k1:prime256v1:secp521r1';
32+
2733
const options = {
2834
key: loadPEM('agent2-key'),
2935
cert: loadPEM('agent2-cert'),
3036
ciphers: '-ALL:ECDHE-RSA-AES128-SHA256',
31-
ecdhCurve: 'secp256k1:prime256v1:secp521r1',
37+
ecdhCurve,
3238
maxVersion: 'TLSv1.2',
3339
};
3440

@@ -60,6 +66,11 @@ const server = tls.createServer(options, (conn) => {
6066
unsupportedCurves.push('brainpoolP256r1');
6167
}
6268

69+
// Deprecated RFC 8422 curves are disabled by default in OpenSSL 4.0.
70+
if (hasOpenSSL(4, 0)) {
71+
unsupportedCurves.push('secp256k1');
72+
}
73+
6374
unsupportedCurves.forEach((ecdhCurve) => {
6475
assert.throws(() => tls.createServer({ ecdhCurve }),
6576
/Error: Failed to set ECDH curve/);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.