From 2cebd5f02b9bf2f8fd1379fdac4714711c9c6617 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Sat, 16 Oct 2021 08:06:53 +0200 Subject: [PATCH] deps: add missing legacyprov.c source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit add the missing legacy provider source code which is requried for statically linking the OpenSSL legacy provider. Co-authored-by: Richard Lau PR-URL: https://github.com/nodejs/node/pull/40478 Refs: https://github.com/nodejs/node/issues/40455 Reviewed-By: Richard Lau Reviewed-By: Tobias Nießen --- deps/openssl/config/generate_gypi.pl | 19 ++++++++++++++++--- deps/openssl/openssl.gyp | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/deps/openssl/config/generate_gypi.pl b/deps/openssl/config/generate_gypi.pl index 99352b4027b4fc..2f5f6d1f2faa9d 100755 --- a/deps/openssl/config/generate_gypi.pl +++ b/deps/openssl/config/generate_gypi.pl @@ -100,11 +100,12 @@ copy("$src_dir/providers/common/include/prov/der_digests.h", "$base_dir/providers/common/include/prov/") or die "Copy failed: $!"; +my $linker_script_dir = "\$(srcdir)/deps/openssl/config/archs/$arch/$asm/providers"; my $fips_linker_script = ""; if ($fips_ld ne "") { - $fips_linker_script = "$base_dir/providers/fips.ld"; + $fips_linker_script = "$linker_script_dir/fips.ld"; copy("$src_dir/providers/fips.ld", - $fips_linker_script) or die "Copy failed: $!"; + "$base_dir/providers/fips.ld") or die "Copy failed: $!"; } @@ -193,6 +194,18 @@ } } +foreach my $obj (@{$unified_info{sources}->{'providers/legacy'}}) { + if ($obj eq 'providers/legacy.ld') { + push(@generated_srcs, $obj); + } else { + my $src = ${$unified_info{sources}->{$obj}}[0]; + #print("providers/fips obj: $obj, src: $src\n"); + if ($src =~ m/\.c$/) { + push(@libcrypto_srcs, $src); + } + } +} + my @libfips_srcs = (); foreach my $obj (@{$unified_info{sources}->{'providers/libfips.a'}}) { my $src = ${$unified_info{sources}->{$obj}}[0]; @@ -316,7 +329,7 @@ arch => \$arch, lib_cppflags => \@lib_cppflags, is_win => \$is_win, - linker_script => \rel2abs($fips_linker_script), + linker_script => $fips_linker_script, }); open(FIPSGYPI, "> ./archs/$arch/$asm/openssl-fips.gypi"); diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp index 4d4e6f28010d29..beb9194166ec39 100644 --- a/deps/openssl/openssl.gyp +++ b/deps/openssl/openssl.gyp @@ -29,6 +29,7 @@ # is able to create a malicious DLL in one of the default search paths. 'OPENSSL_NO_HW', 'OPENSSL_API_COMPAT=0x10100001L', + 'STATIC_LEGACY', #'OPENSSL_NO_DEPRECATED', ], 'conditions': [