From: Randall S. Becker Date: Sun, 20 Sep 2020 22:30:14 +0000 (-0600) Subject: Added FIPS DEP initialization for the NonStop platform in fips/self_test.c. X-Git-Tag: openssl-3.0.0-alpha7~166 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b1428ac12749f7ff0e49be363e9f7097f0e58b0;p=thirdparty%2Fopenssl.git Added FIPS DEP initialization for the NonStop platform in fips/self_test.c. CLA: Permission is granted by the author to the OpenSSL team to use these modifications. Fixes #12918 Signed-off-by: Randall S. Becker Reviewed-by: Paul Dale Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/12928) --- diff --git a/providers/fips/self_test.c b/providers/fips/self_test.c index 9d95f0ccf1..81f475e900 100644 --- a/providers/fips/self_test.c +++ b/providers/fips/self_test.c @@ -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)