LM,
Thanks for jumping in the bus with me :)
I haven't had a chance to work through your last email, but was planning to 
soon.  I see you attached your make file also, which I need to try out.

I get very similar errors, but not the same functions.

Mine look like:
VED.obj : Error LNK2019: unresolved external symbol _FIPS_hmac_ctx_cleanup 
referenced in function void __cdecl dofile(struct _iobuf *)" 
(?dofile@@YAXPAU_iobuif@@@Z)

And similar for:
FIPS_hmac_final
FIPS_hmac_update
FIPS_hmac_init_ex
FIPS_evp_sha1
FIPS_hmac_ctx_init

I'm using fipslink.pl as is and didn't have to modify it.  Did you have to 
modify yours before you called ntdll.mak?  It's used in there.

Also, it looks like you are stuck on fips_premain.  I don't include that in my 
makefile directly because fipslink.pl is suppose to do it for me.  fips_premain 
compiles and I don't have any link errors from fips_premain.obj.

My equivalent of your @"link.rsp" does not have fips_premain in it.  I thought 
fipslink compiled and linked that for me.

M my fipslink.pl dies at "First stage Link Failure" - Line 55, which is the 
same place you get to.

I can't really copy my make files because they are on a secure system, so I 
have to type everything here. 

Thanks,
-Jon 

-----Original Message-----
From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] 
On Behalf Of Memmott, Lester
Sent: Wednesday, February 06, 2013 11:40 AM
To: openssl-users@openssl.org
Subject: RE: fipslink

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: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] 
On Behalf Of Jon Evers
Sent: Tuesday, February 05, 2013 2:09 PM
To: openssl-users@openssl.org
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"Ϯrm
(Z+K+1x
h[z(Z+
fyfh)z{,

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.

Reply via email to