I asked this on the openssl-users mailing list with no replies, so I thought I'd try here.
I am trying to build a Windows DLL that includes the static OpenSSL FIPS libraries. I built the FIPS libraries using perl Configure fips --with-fipslibdir=... -no-shared
and then nmake -f ms\nt.mak
. I'm using openssl-fips-2.0.5, openssl-1.0.1j, and MS Visual Studio 2010.
Now I'm trying to link the resulting libraries into my DLL. I've followed the instructions in the OpenSSL FIPS 2.0 User's Guide, setting a bunch of environment variables (FIPS_LINK, FIPS_CC, FIPS_CC_ARGS, etc.) and then called fipslink.pl
. But I'm getting a "First stage Link failure".
It reports "Integrity check OK" and then compiles fips_premain.c, but when linking the DLL I get a bunch of "locally defined symbol _time64 imported" warnings (as well as strncmp, _errno, abort, fprintf, and others), and then some unresolved external symbols including:
__imp_strncpy
__imp_qsort
__imp_wcsstr
__imp_vsnwprintf
All of the errors come from libeayfips32.lib, libeaycompat32.lib, and ssleay32.lib.
I've played around with adding and removing things like /NODEFAULTLIB:msvcrt
and /NODEFAULTLIB:libcmtd
, and building with /MT
or /MD
or neither, but I keep getting linker errors each time. What am I missing?