Skip to content

Commit 47fa4c8

Browse files
codebytereclaude
andcommitted
fix(patch): guard DH key test for BoringSSL
BoringSSL does not support loading DH private keys from PEM, causing createPrivateKey to throw UNSUPPORTED_ALGORITHM. Ref: nodejs/node#62240 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 983925e commit 47fa4c8

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

patches/node/.patches

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ api_promote_deprecation_of_v8_context_and_v8_object_api_methods.patch
4040
fix_ensure_traverseparent_bails_on_resource_path_exit.patch
4141
reland_temporal_unflag_temporal.patch
4242
build_restore_macos_deployment_target_to_12_0.patch
43-
fix_generate_config_gypi_needs_to_generate_valid_json.patch
44-
fix_add_externalpointertypetag_to_v8_external_api_calls.patch

patches/node/fix_crypto_tests_to_run_with_bssl.patch

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ index d22281abbd5c3cab3aaa3ac494301fa6b4a8a968..5f0c6a4aed2e868a1a1049212edf2187
250250
s.pipe(h).on('data', common.mustCall(function(c) {
251251
assert.strictEqual(c, expect);
252252
diff --git a/test/parallel/test-crypto-key-objects-raw.js b/test/parallel/test-crypto-key-objects-raw.js
253-
index f301cc1942fd9a46ea91e18e580504d09ce53e48..95d4e1fc7671233e017177025813f46bad50f2f0 100644
253+
index f301cc1942fd9a46ea91e18e580504d09ce53e48..a025c74d8832e55999f7513e9525d48533670c4b 100644
254254
--- a/test/parallel/test-crypto-key-objects-raw.js
255255
+++ b/test/parallel/test-crypto-key-objects-raw.js
256256
@@ -34,10 +34,13 @@ const { hasOpenSSL } = require('../common/crypto');
@@ -270,6 +270,15 @@ index f301cc1942fd9a46ea91e18e580504d09ce53e48..95d4e1fc7671233e017177025813f46b
270270
const pubKeyObj = crypto.createPublicKey(
271271
fixtures.readKey(pub, 'ascii'));
272272
const privKeyObj = crypto.createPrivateKey(
273+
@@ -58,7 +61,7 @@ const { hasOpenSSL } = require('../common/crypto');
274+
}
275+
276+
// DH keys also don't support raw formats
277+
- {
278+
+ if (!process.features.openssl_is_boringssl) {
279+
const privKeyObj = crypto.createPrivateKey(
280+
fixtures.readKey('dh_private.pem', 'ascii'));
281+
assert.throws(() => privKeyObj.export({ format: 'raw-private' }),
273282
@@ -224,7 +227,9 @@ if (hasOpenSSL(3, 5)) {
274283
assert.throws(() => ecPriv.export({ format: 'raw-seed' }),
275284
{ code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS' });

0 commit comments

Comments
 (0)