I asked about this on the openssl-users unanswered mailing list, so I decided to give it a try here.
I am trying to create a Windows DLL that includes the OpenSSL FIPS static libraries. I built the FIPS libraries using perl Configure fips --with-fipslibdir=... -no-shared, and then nmake -f ms\nt.mak. I am using openssl-fips-2.0.5, openssl-1.0.1j and MS Visual Studio 2010.
Now I am trying to link the resulting libraries with my DLL. I followed the instructions in the OpenSSL FIPS 2.0 User Guide by setting a bunch of environment variables (FIPS_LINK, FIPS_CC, FIPS_CC_ARGS, etc.), and then called fipslink.pl, But I get a "first stage failure".
It reports “Integrity Check OK,” and then compiles the file fips_premain.c, but when linking the DLL, I get a bunch of “locally defined _time64 imported” characters warnings (as well as strncmp, _errno, abort, fprintf and others), and then some unresolved external characters including:
__ imp_strncpy
__imp_qsort
__imp_wcsstr
__imp_vsnwprintf
All errors come from libeayfips32.lib, libeaycompat32.lib and ssleay32.lib.
I played with adding and removing things like /NODEFAULTLIB:msvcrtand /NODEFAULTLIB:libcmtdand created with /MTor /MDor none of them, but every time I get linker errors. What am I missing?