I'm able to build a simple application using fips openssl library. Here is my build script:
SET FIPS_PATH=D:\usr\local\ssl\fips-2.0 SET INC_D=D:\openssl-1.0.1c\inc32 SET INCL_D=D:\openssl-1.0.1c\tmp32 SET INC=-I %INC_D% -I %INCL_D% SET CFLAG=/MD /Ox -DOPENSSL_THREADS -DDSO_WIN32 -W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -I\usr\local\ssl\fips-2.0/include -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_KRB5 -DOPENSSL_FIPS -DOPENSSL_NO_JPAKE -DOPENSSL_NO_DYNAMIC_ENGINE SET LIB_CFLAG= /Zl /Zi SET SHLIB_CFLAG= SET SHLIB_CFLAGS=%INC% %CFLAG% %LIB_CFLAG% %SHLIB_CFLAG% SET FIPS_LINK=link SET FIPS_CC=cl SET FIPS_CC_ARGS=/FoD:\Projects\TestPrograms\TestFIPSOpenssl\x64\Release\ %SHLIB_CFLAGS% -c SET PREMAIN_DSO_EXE= SET FIPS_TARGET=D:\Projects\TestPrograms\TestFIPSOpenssl\x64\Release\TestFIPSOpenssl.exe SET FIPS_SHA1_EXE=%FIPS_PATH%\bin\fips_standalone_sha1.exe SET FIPSLIB_D=%FIPS_PATH%\lib perl %FIPS_PATH%\bin\fipslink.pl /nologo /subsystem:console /opt:ref /debug /map /OUT:"D:\Projects\TestPrograms\TestFIPSOpenssl\x64\Release\TestFIPSOpenssl.exe" /LIBPATH:\"D:\usr\local\ssl\fips-2.0\lib\" /LIBPATH:\"D:\openssl-1.0.1c\out32\" ssleay32.lib libeayfips32.lib fipscanister.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib x64\Release\main.obj x64\Release\fips_premain.obj Hope it helps! Thanks Raghav On Wed, Apr 3, 2013 at 6:45 PM, Raghav Varadan <raghavssubscr...@gmail.com>wrote: > Alrite Thanks Jon! > > Did anyone else had any success on linking your application with fips > capable static libraries? I have been stuck on this and I would appreciate > any help. > > Thanks > > Raghav > > > On Wed, Apr 3, 2013 at 6:15 PM, Jon Evers <jon.ev...@go2vanguard.com>wrote: > >> I could either get it to link, but fail the premain test or not get it >> to link. I never did get even a simple application to compile and run.** >> ** >> >> I haven’t had time since my last post to work on it. I’ve been side >> tracked by our (way behind) software release. **** >> >> -Jon Evers**** >> ------------------------------ >> >> *From:* owner-openssl-us...@openssl.org [mailto: >> owner-openssl-us...@openssl.org] *On Behalf Of *Raghav Varadan >> *Sent:* Wednesday, April 03, 2013 5:59 PM >> >> *To:* openssl-users@openssl.org >> *Subject:* Re: fipslink >> **** >> >> ** ** >> >> Jon,**** >> >> I have the same problem that you were mentioning in your thread. I built >> a batch file similar to yours and I'm getting the link error in the first >> pass. Were you able to find a solution for this? >> >> >> >> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ >> **** >> >> Following are the link errors I'm getting: >> >> fips_premain.obj : error LNK2001: unresolved external symbol "unsigned >> char * FIPS_signature" (?FIPS_signature@@3PAEA) >> fips_premain.obj : error LNK2019: unresolved external symbol "unsigned >> int __cdecl FIPS_incore_fingerprint(unsigned char *,unsigned int)" >> (?FIPS_incor >> e_fingerprint@@YAIPEAEI@Z) referenced in function "void __cdecl >> FINGERPRINT_premain(void)" (?FINGERPRINT_premain@@YAXXZ) >> fips_premain.obj : error LNK2019: unresolved external symbol "void const >> * __cdecl FIPS_text_start(void)" (?FIPS_text_start@@YAPEBXXZ) referenced >> in f >> unction "void __cdecl FINGERPRINT_premain(void)" (?FINGERPRINT_premain@ >> @YAXXZ) >> >> >> >> ------------------------------------------------------------------------------------------------------------------------------------------- >> **** >> >> Here is my log: >> >> >> D:\TestPrograms\TestFIPSOpenssl>cl /Od /I >> "D:\OpenSSL\deploy\Applications_win64_x64\include" /I >> "D:\Dev\WrkSpace_Main\depot\ExternalLibs\OpenSSL\1.0.1c-fips2.0.3\fips-src\include" >> /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc >> /RTC1 /MDd /Fo"x64\Debug\\" /Fd"x64\Debug\vc90.pdb" /W3 /nologo /c /Zi /TC >> /errorReport:prompt main.c >> main.c >> >> D:\TestPrograms\TestFIPSOpenssl>fips_build_script.bat >> >> D:\TestPrograms\TestFIPSOpenssl>SET >> FIPS_PATH=D:\OpenSSL\deploy\Applications_win64_x64 >> >> D:\TestPrograms\TestFIPSOpenssl>SET FIPS_LINK=link >> >> D:\TestPrograms\TestFIPSOpenssl>SET FIPS_CC=cl >> >> D:\TestPrograms\TestFIPSOpenssl>SET FIPS_CC_ARGS=/Fo >> D:\TestPrograms\TestFIPSOpenssl\x64\Debug\fips_premain.obj >> -ID:\Dev\WrkSpace_Ma >> in\depot\ExternalLibs\OpenSSL\1.0.1c-fips2.0.3\_deploy\Applications_win64_x64\include >> /MD /O1 -DOPENSSL_THREADS -DDSO_WIN32 -DOPENSSL_NO_ERR -W3 -Gs0 >> -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN >> -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE >> -ID:\Dev\WrkSpace_Main\depot\Ext >> ernalLibs\OpenSSL\1.0.1c-fips2.0.3\_deploy\Applications_win64_x64/include/GS >> -DOPENSSL_NO_IDEA -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC >> 2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_RIPEMD -DOPENSSL_NO_MDC2 >> -DOPENSSL_NO_BF -DOPENSSL_NO_CAST -DOPENSSL_NO_DH -DOPENSSL_NO_WHIRLPOOL -DO >> PENSSL_NO_SSL2 -DOPENSSL_NO_CMS -DOPENSSL_NO_ERR -DOPENSSL_NO_KRB5 >> -DOPENSSL_NO_GOST -DOPENSSL_NO_HW -DOPENSSL_FIPS -DOPENSSL_NO_JPAKE >> -DOPENSSL_NO_DY >> NAMIC_ENGINE /Zl /Z7 -c >> >> D:\TestPrograms\TestFIPSOpenssl>SET PREMAIN_DSO_EXE= >> >> D:\TestPrograms\TestFIPSOpenssl>SET >> FIPS_TARGET=D:\TestPrograms\TestFIPSOpenssl\x64\Debug\TestFIPSOpenssl.exe >> >> D:\TestPrograms\TestFIPSOpenssl>SET >> FIPS_SHA1_EXE=D:\OpenSSL\deploy\Applications_win64_x64\bin\fips_standalone_sha1.exe >> >> D:\TestPrograms\TestFIPSOpenssl>SET >> FIPSLIB_D=D:\OpenSSL\deploy\Applications_win64_x64\lib >> >> D:\TestPrograms\TestFIPSOpenssl>perl >> D:\OpenSSL\deploy\Applications_win64_x64\bin\fips >> link.pl/OUT:"D:\TestPrograms\TestFIPSOpenssl\x64\Debug\TestFIPSOpenssl.exe" >> /NOLOGO /LIBPATH:"D:\Dev\WrkSpace_Main\depot\ExternalLibs\OpenSS >> L\1.0.1c-fips2.0.3\_deploy\Applications_win64_x64\lib" /MANIFEST >> /MANIFESTFILE:\"x64\Debug\TestFIPSOpenssl.exe.intermediate.manifest\" >> /MANIFESTUAC:\" >> level='asInvoker' uiAccess='false'\" /DEBUG >> /PDB:\"D:\TestPrograms\TestFIPSOpenssl\x64\Debug\TestFIPSOpenssl.pdb\" >> /SUBSYSTEM:CONSOLE /DYNAMI >> CBASE /NXCOMPAT /MACHINE:X64 /ERRORREPORT:PROMPT fipscanister.lib >> opensslcryptofips.lib opensslssl.lib kernel32.lib user32.lib gdi32.lib >> winspool.lib >> comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib >> odbc32.lib odbccp32.lib x64\Debug\main.obj x64\Debug\fips_premain.obj >> >> Integrity check OK >> >> cl /Fo D:\TestPrograms\TestFIPSOpenssl\x64\Debug\fips_premain.obj >> -ID:\OpenSSL\deploy\ >> Applications_win64_x64\include /MD /O1 -DOPENSSL_THREADS -DDSO_WIN32 >> -DOPENSSL_NO_ERR -W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 >> -DWIN32_LEAN_AND_M >> EAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE >> -ID:\OpenSSL\deploy\Applications >> _win64_x64/include/GS -DOPENSSL_NO_IDEA -DOPENSSL_NO_CAMELLIA >> -DOPENSSL_NO_SEED -DOPENSSL_NO_RC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 >> -DOPENSSL_NO_RIPEMD >> -DOPENSSL_NO_MDC2 -DOPENSSL_NO_BF -DOPENSSL_NO_CAST -DOPENSSL_NO_DH >> -DOPENSSL_NO_WHIRLPOOL -DOPENSSL_NO_SSL2 -DOPENSSL_NO_CMS -DOPENSSL_NO_ERR >> -DOPEN >> SSL_NO_KRB5 -DOPENSSL_NO_GOST -DOPENSSL_NO_HW -DOPENSSL_FIPS >> -DOPENSSL_NO_JPAKE -DOPENSSL_NO_DYNAMIC_ENGINE /Zl /Z7 -c >> D:\Dev\WrkSpace_Main\depot >> >> \ExternalLibs\OpenSSL\1.0.1c-fips2.0.3\_deploy\Applications_win64_x64\lib/fips_premain.c >> cl : Command line warning D9027 : source file >> 'D:\TestPrograms\TestFIPSOpenssl\x64\Debug\fips_premain.obj' ignored >> fips_premain.c >> link /OUT:D:\TestPrograms\TestFIPSOpenssl\x64\Debug\TestFIPSOpenssl.exe >> /NOLOGO /LIBPATH:D:\Dev\WrkSpace_Main\depot\ExternalLibs\OpenSSL\1.0. >> 1c-fips2.0.3\_deploy\Applications_win64_x64\lib /MANIFEST >> /MANIFESTFILE:"x64\Debug\TestFIPSOpenssl.exe.intermediate.manifest" >> /MANIFESTUAC:"level='asI >> nvoker' uiAccess='false'" /DEBUG >> /PDB:"D:\TestPrograms\TestFIPSOpenssl\x64\Debug\TestFIPSOpenssl.pdb" >> /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMP >> AT /MACHINE:X64 /ERRORREPORT:PROMPT fipscanister.lib >> opensslcryptofips.lib opensslssl.lib kernel32.lib user32.lib gdi32.lib >> winspool.lib comdlg32.lib >> advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib >> odbccp32.lib x64\Debug\main.obj x64\Debug\fips_premain.obj >> MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' >> conflicts with use of other libs; use /NODEFAULTLIB:library >> >> fips_premain.obj : error LNK2001: unresolved external symbol "unsigned >> char * FIPS_signature" (?FIPS_signature@@3PAEA) >> fips_premain.obj : error LNK2019: unresolved external symbol "unsigned >> int __cdecl FIPS_incore_fingerprint(unsigned char *,unsigned int)" >> (?FIPS_incor >> e_fingerprint@@YAIPEAEI@Z) referenced in function "void __cdecl >> FINGERPRINT_premain(void)" (?FINGERPRINT_premain@@YAXXZ) >> fips_premain.obj : error LNK2019: unresolved external symbol "void const >> * __cdecl FIPS_text_start(void)" (?FIPS_text_start@@YAPEBXXZ) referenced >> in f >> unction "void __cdecl FINGERPRINT_premain(void)" (?FINGERPRINT_premain@ >> @YAXXZ) >> D:\TestPrograms\TestFIPSOpenssl\x64\Debug\TestFIPSOpenssl.exe : fatal >> error LNK1120: 3 unresolved externals >> First stage Link failure at D:\OpenSSL\deploy\Applications_win64_x64\bin\ >> fipslink.pl line 55.**** >> >> ** ** >> >> Thanks!**** >> >> Regards,**** >> >> Raghav**** >> >> ** ** >> >> ** ** >> >> On Thu, Feb 7, 2013 at 2:26 PM, Dave Thompson <dthomp...@prinpay.com> >> wrote:**** >> >> > From: owner-openssl-us...@openssl.org On Behalf Of Jeffrey Walton >> > Sent: Wednesday, 06 February, 2013 16:59**** >> >> > To: openssl-users@openssl.org >> > Subject: Re: fipslink >> >**** >> >> > On Wed, Feb 6, 2013 at 2:40 PM, Memmott, Lester >> > <lester.memm...@landesk.com> wrote: >> > > Jon, >> > > >> > > I'm having trouble with fipslink as well and thought it >> > might help to compare notes. These are the linker errors I'm >> > getting using Visual Studio 2008: >> > > fips_premain.obj : error LNK2001: unresolved external >> > symbol "unsigned char * FIPS_signature" (?FIPS_signature@@3PAEA) >> > > fips_premain.obj : error LNK2001: unresolved external >> > symbol "void const * __cdecl FIPS_text_start(void)" >> > (?FIPS_text_start@@YAPBXXZ) >> > > fips_premain.obj : error LNK2001: unresolved external >> > symbol "unsigned int __cdecl FIPS_incore_fingerprint(unsigned >> > char *,unsigned int)" (?FIPS_incore_fingerprint@@YAIPAEI@Z) >> > > >> > > What linker errors do you get? >> > It looks like you are not compiling fips_premain.c (that's where those >> > symbols are allocated storage). >> >**** >> >> I don't think so. In my copy they are *referenced* in fips_premain.c, >> and allocated/defined in fips.c and fips_canister.c . >> >> Those error messages look like fips_premain.c was compiled as C++ >> instead of C. Since by design C++ is a superset of "good" C this >> doesn't cause errors. If OP is compiling in VisualStudio/VisualC++ >> (not just linking) in my experience VisualStudio defaults to >> "force C++" and you have to manually reconfigure to allow C.**** >> >> >> >> ______________________________________________________________________ >> OpenSSL Project http://www.openssl.org >> User Support Mailing List openssl-users@openssl.org >> Automated List Manager majord...@openssl.org*** >> * >> >> ** ** >> >> >> >> *Live customer support* is available 24/7/365 from the U.S. for all >> customers worldwide and locally in other countries. Find out more at >> www.go2vanguard.com. >> >> >> Enable Yourself™ Learn more about Vanguard zSecurity University training >> classes offered online, on-demand by request, or in a traditional classroom >> setting in cities worldwide. www.go2vanguard.com** >> >> >> >> >> This e-mail and any attachments are intended solely for the use of the >> addressee and may contain information that is PRIVILEGED and CONFIDENTIAL. >> If you are not the intended recipient of this e-mail, you are hereby >> notified that any dissemination of this e-mail or any attachments is >> strictly prohibited. If you have received this e-mail in error, please do >> not read this email, please delete all copies of this e-mail and any >> attachments and notify the sender immediately. Thank you.** >> >> >> > >