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 <[email protected]>

PR-URL: #40478
Refs: #40455
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
danbev committed Oct 18, 2021
1 parent ed76b49 commit 2cebd5f
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 2cebd5f

Please sign in to comment.