Skip to content

Commit

Permalink
deps: add missing legacyprov.c source
Browse files Browse the repository at this point in the history
This commit add the missing legacy provider source code which is
requried for statically linking the OpenSSL legacy provider.

Co-authored-by: Richard Lau <rlau@redhat.com>

PR-URL: nodejs#40478
Refs: nodejs#40455
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
danbev authored and pull[bot] committed Jan 14, 2022
1 parent e1f3324 commit 508bb41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions deps/openssl/config/generate_gypi.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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: $!";
}


Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions deps/openssl/openssl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down

0 comments on commit 508bb41

Please sign in to comment.