Hi,
I am having some difficulties linking my application to an openssl-fips static 
library. My development environment is VS2012 / Windows 8. I am able to build 
/install the openssl-fips distribution and I am able to enter fips mode in the 
openssl.exe application that comes with the distribution (openssl-fips-2.0.2 / 
openssl-1.0.1c).

I am looking at page 52 in the OpenSSL User Guide for the Fips Object Module 
where they talk about the environment variables that need to be set before 
calling fipslink.pl. This is what I have:

SET FIPS_LINK=link

SET FIPS_CC=cl

SET 
FIPS_CC_ARGS=/FoC:\source\rlien\Sandbox\TB_OpenSSLCipherStaticLink\TB_OpenSSLCipher\Debug\fips_premain.obj
 -IC:\usr\local\ssl\include 
-IC:\source\rlien\Sandbox\TB_OpenSSLCipherStaticLink\TB_OpenSSLCipher\Debug /MD 
/Ox /O2 /Ob2 -DOPENSSL_THREADS -DDSO_WIN32 -W3 -Gs0 -GF -Gy -nologo 
-DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN 
-D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 
-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -IC:\usr\local\ssl\fips-2.0/include 
-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM 
-DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 
-DOPENSSL_NO_KRB5 -DOPENSSL_FIPS -DOPENSSL_NO_JPAKE -DOPENSSL_NO_DYNAMIC_ENGINE 
/Zl /Zi 
/FdC:\source\rlien\Sandbox\TB_OpenSSLCipherStaticLink\TB_OpenSSLCipher\Debug/lib
 -c

SET 
PREMAIN_DSO_EXE=C:\source\rlien\OEM\openssl\1.0.1c\src\out32\fips_premain_dso.exe
 /* not needed */

SET PREMAIN_SHA1_EXE=C:\usr\local\ssl\fips-2.0\bin\fips_standalone_sha1.exe /* 
not needed */

SET FIPS_SHA1_EXE=C:\usr\local\ssl\fips-2.0\bin\fips_standalone_sha1.exe

SET 
FIPS_TARGET=C:\source\rlien\Sandbox\TB_OpenSSLCipherStaticLink\Debug\TB_OpenSSLCipher.exe

SET FIPSLIB_D=C:\usr\local\ssl\fips-2.0\lib

SET O_FIPSCANISTER=C:\usr\local\ssl\fips-2.0\lib\fipscanister.lib /* not needed 
*/

perl C:\usr\local\ssl\fips-2.0\bin\fipslink.pl /nologo /subsystem:console 
/opt:ref /machine:x86 /debug /OPT:NOREF /OPT:NOICF /FIXED /DYNAMICBASE:No /map 
/out:C:\source\rlien\Sandbox\TB_OpenSSLCipherStaticLink\Debug\TB_OpenSSLCipher.exe

When I run the above command I get this output:

Integrity check OK
cl /FoC:\source\rlien\Sandbox\TB_OpenSSLCipherStaticLink\TB_OpenSSL
Cipher\Debug\fips_premain.obj -IC:\usr\local\ssl\include -IC:\source\rlien_T3400
RL_4253\Sandbox\TB_OpenSSLCipherStaticLink\TB_OpenSSLCipher\Debug /MD /Ox /O2 /O
b2 -DOPENSSL_THREADS -DDSO_WIN32 -W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN3
2 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_BN_ASM_P
ART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -IC:\u
sr\local\ssl\fips-2.0/include -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DR
MD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DOPENSSL_NO_RC5 -DO
PENSSL_NO_MD2 -DOPENSSL_NO_KRB5 -DOPENSSL_FIPS -DOPENSSL_NO_JPAKE -DOPENSSL_NO_D
YNAMIC_ENGINE /Zl /Zi /FdC:\source\rlien\Sandbox\TB_OpenSSLCipherSt
aticLink\TB_OpenSSLCipher\Debug/lib -c C:\usr\local\ssl\fips-2.0\lib/fips_premai
n.c
fips_premain.c
link /nologo /subsystem:console /opt:ref /machine:x86 /debug /OPT:NOREF /OPT:NOI
CF /FIXED /DYNAMICBASE:No /map /out:C:\source\rlien\Sandbox\TB_Open
SSLCipherStaticLink\Debug\TB_OpenSSLCipher.exe
LINK : warning LNK4001: no object files specified; libraries used
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
C:\source\rlien\Sandbox\TB_OpenSSLCipherStaticLink\Debug\TB_OpenSSL
Cipher.exe : fatal error LNK1120: 1 unresolved externals
First stage Link failure at C:\usr\local\ssl\fips-2.0\bin\fipslink.pl line 55.

Has anyone experienced the same problem? Any help would be greatly appreciated.

- Roar

Reply via email to