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 e08fef1

Browse filesBrowse files
danbevcodebytere
authored andcommitted
test: add secp224k1 check in crypto-dh-stateless
This commit adds a check to test-crypto-dh-statless to avoid an error if the curve secp224k1 is not present. This could occur if node was configured with shared-openssl. The use case for this was building on RHEL 8.1 which only has the following curves: $ openssl ecparam -list_curves secp224r1 : NIST/SECG curve over a 224 bit prime field secp256k1 : SECG curve over a 256 bit prime field secp384r1 : NIST/SECG curve over a 384 bit prime field secp521r1 : NIST/SECG curve over a 521 bit prime field prime256v1: X9.62/SECG curve over a 256 bit prime field PR-URL: #31715 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 776f379 commit e08fef1
Copy full SHA for e08fef1

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-crypto-dh-stateless.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-crypto-dh-stateless.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,10 @@ for (const [params1, params2] of [
196196
test(crypto.generateKeyPairSync('ec', { namedCurve: 'secp256k1' }),
197197
crypto.generateKeyPairSync('ec', { namedCurve: 'secp256k1' }));
198198

199+
const not256k1 = crypto.getCurves().find((c) => /^sec.*(224|384|512)/.test(c));
199200
assert.throws(() => {
200201
test(crypto.generateKeyPairSync('ec', { namedCurve: 'secp256k1' }),
201-
crypto.generateKeyPairSync('ec', { namedCurve: 'secp224k1' }));
202+
crypto.generateKeyPairSync('ec', { namedCurve: not256k1 }));
202203
}, {
203204
name: 'Error',
204205
code: 'ERR_OSSL_EVP_DIFFERENT_PARAMETERS'

0 commit comments

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