]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Added FIPS DEP initialization for the NonStop platform in fips/self_test.c.
authorRandall S. Becker <rsbecker@nexbridge.com>
Sun, 20 Sep 2020 22:30:14 +0000 (16:30 -0600)
committerRichard Levitte <levitte@openssl.org>
Tue, 22 Sep 2020 05:52:39 +0000 (07:52 +0200)
CLA: Permission is granted by the author to the OpenSSL team to use these modifications.
Fixes #12918

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12928)

providers/fips/self_test.c

index 9d95f0ccf15a14a1e853adbec346cfe246c7616a..81f475e90090fb016edf68e5492d17918c3eece8 100644 (file)
@@ -123,6 +123,22 @@ DEP_DECLARE()
 #elif defined(__GNUC__)
 # define DEP_INIT_ATTRIBUTE static __attribute__((constructor))
 # define DEP_FINI_ATTRIBUTE static __attribute__((destructor))
+
+#elif defined(__TANDEM)
+DEP_DECLARE() /* must be declared before calling init() or cleanup() */
+# define DEP_INIT_ATTRIBUTE
+# define DEP_FINI_ATTRIBUTE
+
+/* Method automatically called by the NonStop OS when the DLL loads */
+void __INIT__init(void) {
+    init();
+}
+
+/* Method automatically called by the NonStop OS prior to unloading the DLL */
+void __TERM__cleanup(void) {
+    cleanup();
+}
+
 #endif
 
 #if defined(DEP_INIT_ATTRIBUTE) && defined(DEP_FINI_ATTRIBUTE)