fix wrong error message in FIPS140_SampleApplication

fix DLL startup problem on Windows 9x
pull/2/head
weidai 2003-07-18 03:19:37 +00:00
parent 37db5ab134
commit 41230ef866
1 changed files with 25 additions and 1 deletions

View File

@ -156,7 +156,8 @@ void FIPS140_SampleApplication()
// try to use an invalid key length
try
{
encryption_DES_EDE3_CBC.SetKey(key, 5);
ECB_Mode<DES_EDE3>::Encryption encryption_DES_EDE3_ECB;
encryption_DES_EDE3_ECB.SetKey(key, 5);
// should not be here
cerr << "DES-EDE3 implementation did not detect use of invalid key length.\n";
@ -171,6 +172,29 @@ void FIPS140_SampleApplication()
cout << "\nFIPS 140-2 Sample Application completed normally.\n";
}
#ifdef CRYPTOPP_IMPORTS
static PNew s_pNew = NULL;
static PDelete s_pDelete = NULL;
extern "C" __declspec(dllexport) void CRYPTOPP_CDECL SetNewAndDeleteFromCryptoPP(PNew pNew, PDelete pDelete, PSetNewHandler pSetNewHandler)
{
s_pNew = pNew;
s_pDelete = pDelete;
}
void * CRYPTOPP_CDECL operator new (size_t size)
{
return s_pNew(size);
}
void CRYPTOPP_CDECL operator delete (void * p)
{
s_pDelete(p);
}
#endif
#ifdef CRYPTOPP_DLL_ONLY
int CRYPTOPP_CDECL main()