chore: remove unnecessary crypto patch (#20669)

This commit is contained in:
Shelley Vohr 2019-10-21 17:14:21 -07:00 committed by Cheng Zhao
parent aa26e8b946
commit e3b30a825c
2 changed files with 0 additions and 49 deletions

View file

@ -13,7 +13,6 @@ feat_add_new_built_with_electron_variable_to_config_gypi.patch
feat_add_flags_for_low-level_hooks_and_exceptions.patch
export_environment_knodecontexttagptr.patch
fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
fix_use_bssl_bn_bn2bin_padded_for_ossl_s_bn_bn2binpad.patch
pass_all_globals_through_require.patch
call_process_log_from_fallback_stream_on_windows.patch
fixme_use_redefined_version_of_internalmodulestat.patch

View file

@ -1,48 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Wed, 19 Dec 2018 08:54:45 +0530
Subject: fix: use bssl BN_bn2bin_padded for ossl's BN_bn2binpad
Also note that BN_bn2bin_padded returns 1 on success instead of size
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 91e62f41b3db02bac516e6e91ffb77d5476fb9ad..dd78a59742fc05e938ba2397d3701b2ac8ccfc23 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -5453,9 +5453,9 @@ void DiffieHellman::GenerateKeys(const FunctionCallbackInfo<Value>& args) {
const int size = BN_num_bytes(pub_key);
CHECK_GE(size, 0);
AllocatedBuffer data = env->AllocateManaged(size);
- CHECK_EQ(size,
- BN_bn2binpad(
- pub_key, reinterpret_cast<unsigned char*>(data.data()), size));
+ CHECK_EQ(
+ 1,
+ BN_bn2bin_padded(reinterpret_cast<unsigned char*>(data.data()), size, pub_key));
args.GetReturnValue().Set(data.ToBuffer().ToLocalChecked());
}
@@ -5475,8 +5475,8 @@ void DiffieHellman::GetField(const FunctionCallbackInfo<Value>& args,
CHECK_GE(size, 0);
AllocatedBuffer data = env->AllocateManaged(size);
CHECK_EQ(
- size,
- BN_bn2binpad(num, reinterpret_cast<unsigned char*>(data.data()), size));
+ 1,
+ BN_bn2bin_padded(reinterpret_cast<unsigned char*>(data.data()), size, num));
args.GetReturnValue().Set(data.ToBuffer().ToLocalChecked());
}
@@ -5793,9 +5793,9 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo<Value>& args) {
const int size = BN_num_bytes(b);
AllocatedBuffer out = env->AllocateManaged(size);
- CHECK_EQ(size, BN_bn2binpad(b,
- reinterpret_cast<unsigned char*>(out.data()),
- size));
+ CHECK_EQ(1, BN_bn2bin_padded(reinterpret_cast<unsigned char*>(out.data()),
+ size,
+ b));
Local<Object> buf = out.ToBuffer().ToLocalChecked();
args.GetReturnValue().Set(buf);