I am trying to use a statically link OpenSSL in FIPS mode on IBM PLinux using
xlC_r as the compiler/linker. This combination is not supported by fipsld or
fips_premain.c. fipld will add linker options to call FINGERPRINT_premain on
uname -s in {OSF1, IRIX, HP-UX, AIX, Darwin}, fips_premain.c will do compiler
specific solutions for gcc, cl(Microsoft), cc(SUN), and some others that I am
not familiar with. Unfortunately xlC_r on IBM PLinux is not covered by either
of those so I would like to know if adding the following code to one of my cpp
files is acceptable for FIPS validation or if I need to change my
compiler/linker to gcc or is there another way(linker options?) to keep xlC_r.
Please include some justification.
#if defined(PREMAIN_NOT_COVERED)
extern "C" void FINGERPRINT_premain(void);
class FIPSInitializer
{
public:
FIPSInitializer()
{
FINGERPRINT_premain();
}
virtual ~FIPSInitializer()
{
}
};
extern FIPSInitializer fips_initializer;
FIPSInitializer fips_initializer;
#endif
I also tried using -Wl,init,FINGERPRINT_premain while linking, but then our
test would segfault while using our shared library.
-Ty