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?
Below are more details on how I did this using a batch file to setup the
environment variables that calls the perl script.
Also not that I had to edit fipslink.pl to make it run. I added "perl" to
these two lines (about line 57 & 58):
print "perl $fips_premain_dso $fips_target\n";
system("perl $fips_premain_dso $fips_target >$fips_target.sha1");
Thanks,
LM
=======================================================
I created this batch file to run the perl script:
@echo off
rem This batch file is intended to build FipsSample.exe in a FIPS enabled
fashion.
rem Built the project first in Visual Studio 2008 and then run this as a post
build step.
rem See section 5.3.2 "Linking under Windows" of the OpenSSL FIPS User Guide
for details about this.
rem http://www.openssl.org/docs/fips/UserGuide-2.0.pdf
rem Note: I think the docs are wrong on a couple of items.
rem It should be FIPS_SHA1_EXE and not PREMAIN_SHA1_EXE.
rem Associated files: link.rsp
@echo on
set FIPSLIB_D=c:\openssl-fips-2.0.2\out32dll
set FIPS_CC=cl
set FIPS_CC_ARGS=/O2 /Oi /GL /I "C:\openssl-1.0.1c\inc32" /D "WIN32" /D
"NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /EHsc /MD /Gy /Fo"Release\\"
/Fd"Release\vc90.pdb" /W3 /c /Zi /TP
set FIPS_LINK=link
set FIPS_SHA1_EXE=C:\openssl-fips-2.0.2\out32dll\fips_standalone_sha1.exe
rem The following wasn't documented in the user guide but the script tries to
use it. msincore seems like the right script, but I'm not sure.
set FIPS_SIG=C:\openssl-fips-2.0.2\util\msincore
rem Not used to compile an EXE: set
PREMAIN_DSO_EXE=C:\openssl-1.0.1c\out32dll\fips_premain_dso.exe
set PREMAIN_DSO_EXE=
set FIPS_TARGET=..\Release\FipsSample.exe
perl c:\openssl-fips-2.0.2\util\fipslink.pl @"link.rsp"
=======================================================
link.rsp:
/OUT:"C:\openssl-TestUtils\FipsSample - Clean\Release\FipsSample.exe"
/INCREMENTAL:NO /LIBPATH:"C:\openssl-1.0.1c\out32dll" /MANIFEST
/MANIFESTFILE:"Release\FipsSample.exe.intermediate.manifest"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG
/PDB:"c:\openssl-TestUtils\FipsSample - Clean\Release\FipsSample.pdb"
/SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE /NXCOMPAT /MACHINE:X86
libeay32.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
".\Release\FipsSample.obj"
".\Release\stdafx.obj"
".\Release\fips_premain.obj"
=======================================================
Build Output:
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>g
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>set
FIPSLIB_D=c:\openssl-fips-2.0.2\out32dll
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>set FIPS_CC=cl
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>set FIPS_CC_ARGS=/O2 /Oi /GL
/I "C:\openssl-1.0.1c\inc32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD
/EHsc /MD /Gy /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /c /Zi /TP
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>set FIPS_LINK=link
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>set
FIPS_SHA1_EXE=C:\openssl-fips-2.0.2\out32dll\fips_standalone_sha1.exe
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>set
FIPS_SIG=C:\openssl-fips-2.0.2\util\msincore
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>rem Not used to comple an
EXE: set PREMAIN_DSO_EXE=C:\openssl-1.0.1c\out32dll\fips_premain_dso.exe
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>set PREMAIN_DSO_EXE=
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>set
FIPS_TARGET=..\Release\FipsSample.exe
C:\openssl-TestUtils\FipsSample - Clean\FipsSample>perl
c:\openssl-fips-2.0.2\util\fipslink.pl @"link.rsp"
Integrity check OK
cl /O2 /Oi /GL /I "C:\openssl-1.0.1c\inc32" /D "WIN32" /D "NDEBUG" /D
"_CONSOLE" /D "_MBCS" /FD /EHsc /MD /Gy /Fo"Release\\" /Fd"Release\vc90.pdb"
/W3 /c /Zi /T
P c:\openssl-fips-2.0.2\out32dll/fips_premain.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
fips_premain.c
link @link.rsp
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
"/OUT:C:\openssl-TestUtils\FipsSample - Clean\Release\FipsSample.exe"
/INCREMENTAL:NO "/LIBPATH:C:\openssl-1.0.1c\out32dll" /MANIFEST
"/MANIFESTFILE:Release\Fip
sSample.exe.intermediate.manifest" "/MANIFESTUAC:level='asInvoker'
uiAccess='false'" /DEBUG "/PDB:c:\openssl-TestUtils\FipsSample -
Clean\Release\FipsSample.pdb
" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE /NXCOMPAT
/MACHINE:X86 libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi
32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Release\FipsSample.obj"
".\Release\stdafx.obj"
".\Release\fips_premain.obj"
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_fingerpr
int@@YAIPAEI@Z)
C:\openssl-TestUtils\FipsSample - Clean\Release\FipsSample.exe : fatal error
LNK1120: 3 unresolved externals
First stage Link failure at c:\openssl-fips-2.0.2\util\fipslink.pl line 55.
=======================================================
---------------------------------------------------------------------------------------------------------------------------
From: [email protected] [mailto:[email protected]]
On Behalf Of Jon Evers
Sent: Tuesday, February 05, 2013 2:09 PM
To: [email protected]
Subject: fipslink
Does anyone have a windows make file that uses fipslink to build an executable
that they can forward to me?
Alternatively a Visual Studio project that uses that would also help?
The smaller and simpler the project the better.
I’m trying to build a windows executable that uses the fips libraries and I
think I’m not using this utility correctly. I’m stuck with linker errors.
Thanks,
-Jon Evers
:��I"Ϯ��r�m����
(����Z+�K�+����1���x��h����[�z�(����Z+���f�y�������f���h��)z{,���