I've build OpenSSL FIPS container version 2.0.1, then built OpenSSL 1.0.1c using that container (according to the instructions in User Guide for the OpenSSL FIPS Object Module v2.0):
SET FIPSDIR=C:\OpenSSL\FIPS
cd C:\OpenSSL\openssl-fips-2.0.1
ms\do_fips
cd C:\OpenSSL\openssl-1.0.1c
ms\do_nasm
nmake -f ms\ntdll.mak
I've got these imports in my .NET application (which is obviously using the libeay32.dll from above):
[DllImport("libeay32", CallingConvention = CallingConvention.Cdecl)]
public extern static void ERR_load_crypto_strings();
[DllImport("libeay32", CallingConvention = CallingConvention.Cdecl)]
public extern static int ERR_print_errors_fp(SafeHandle file);
[DllImport("libeay32", CallingConvention = CallingConvention.Cdecl)]
public extern static int FIPS_mode_set(int onoff);
The problem is, that when I call FIPS_mode_set(1)
, it is returning 0
, which indicates that FIPS mode could not be enabled.
To try and find out why the problem is, I'm doing this:
ERR_load_crypto_strings();
using (FileStream fs = new FileStream...)
{
ERR_print_errors_fp(fs.SafeFileHandle);
}
Which gives me this error message:
OPENSSL_Uplink(0FAF1000,08): no OPENSSL_Applink
I've tried searching for answers, but have come up empty - any suggestions would be much appreciated!
** UPDATE **
I tried building it using the same steps from a Visual Studio 2008 commandline instead of a Visual Studio 2010 commandline (which I had previously used) - and it worked!
But I have no clue why it won't work with Visual Studio 2010, and I don't want to keep Visual Studio 2008 hanging around forever - any idea how I can get it to build OK with Visual Studio 2010?