Files
electron/patches/node/fix_use_crypto_impls_for_compat.patch
Electron Bot 2ca2a88afc chore: bump node to v14.13.1 (master) (#25824)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-10-08 09:55:59 -07:00

23 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 12 Feb 2020 15:08:04 -0800
Subject: fix: use crypto impls for compat
BoringSSL does not export DSA_get0_q. This patch works around that problem
by using the implementations of those functions as found in the OpenSSL repo.
I plan to try and upstream a version of this.
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 5e0c0fe3530de1f1801c45233613620b84c88140..91cb94d8dbe9db0adbee5e005649188e1ccbcbf9 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -4571,7 +4571,7 @@ static unsigned int GetBytesOfRS(const ManagedEVPPKey& pkey) {
if (base_id == EVP_PKEY_DSA) {
DSA* dsa_key = EVP_PKEY_get0_DSA(pkey.get());
// Both r and s are computed mod q, so their width is limited by that of q.
- bits = BN_num_bits(DSA_get0_q(dsa_key));
+ bits = BN_num_bits(dsa_key->q);
} else if (base_id == EVP_PKEY_EC) {
EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(pkey.get());
const EC_GROUP* ec_group = EC_KEY_get0_group(ec_key);