From: Shane Lontis Date: Mon, 7 Jun 2021 01:33:28 +0000 (+1000) Subject: Fix AIX FIPS DEP. X-Git-Tag: openssl-3.0.0-beta1~171 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69e0f8cca691dc474300422c48e14713ace8dd2c;p=thirdparty%2Fopenssl.git Fix AIX FIPS DEP. The entry point needs the option 'binitfini', but it was not being added since the perl code to detect the match did not work. The entry point for AIX is no longer static - so a wrapper has been added to call the static version. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15636) --- diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index a07624e96b3..138ad8a6ae0 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -1180,7 +1180,7 @@ my %targets = ( module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry", shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry", shared_defflag => "-Wl,-bE:", - shared_fipsflag => "-Wl,-binitfini:init:cleanup", + shared_fipsflag => "-Wl,-binitfini:_init:_cleanup", perl_platform => 'AIX', }, "aix-gcc" => { diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index 80f38dd1a2c..ff04e651632 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -1838,7 +1838,7 @@ EOF my @deps = compute_lib_depends(@{$args{deps}}); my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs); # Next line needs to become "less magic" (see PR #11950) - $shared_def .= ' '.$target{shared_fipsflag} if (m/providers\/fips/ && defined $target{shared_fipsflag}); + $shared_def .= ' '.$target{shared_fipsflag} if (defined $target{shared_fipsflag} && $shared_def =~ m/providers\/fips/); my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs)); my $deps = join(" \\\n" . ' ' x (length($dso) + 2), fill_lines(' ', $COLUMNS - length($dso) - 2, diff --git a/providers/fips/self_test.c b/providers/fips/self_test.c index a4d7a4ffe20..e6813e292da 100644 --- a/providers/fips/self_test.c +++ b/providers/fips/self_test.c @@ -105,10 +105,24 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) } return TRUE; } -#elif defined(__sun) || defined(_AIX) +#elif defined(__sun) # pragma init(init) # pragma fini(cleanup) +#elif defined(_AIX) +void _init(void); +void _cleanup(void); +# pragma init(_init) +# pragma fini(_cleanup) +void _init(void) +{ + init(); +} +void _cleanup(void) +{ + cleanup(); +} + #elif defined(__hpux) # pragma init "init" # pragma fini "cleanup"