Fix AIX FIPS DEP.
authorShane Lontis <shane.lontis@oracle.com>
Mon, 7 Jun 2021 01:33:28 +0000 (11:33 +1000)
committerPauli <pauli@openssl.org>
Tue, 8 Jun 2021 05:18:00 +0000 (15:18 +1000)
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 <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15636)

Configurations/10-main.conf
Configurations/unix-Makefile.tmpl
providers/fips/self_test.c

index a07624e96b3dff3212ebd1581bd5777d9c05fda0..138ad8a6ae0c2c3b1e5471489b87574d34b7cc4a 100644 (file)
@@ -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" => {
index 80f38dd1a2c89eb3d587d7b0dd3b5a2dd5a151c7..ff04e651632c86c644287d7f6c25e98f1844596b 100644 (file)
@@ -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,
index a4d7a4ffe203ca6f94bafb13bc829d2cab0680c9..e6813e292da8dd8529464714dcca3b9848bdb28c 100644 (file)
@@ -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"