diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-18 03:19:37 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-18 03:19:37 +0000 |
commit | 4a2b40dd704e7763a00a174dac932f0cf14d01d3 (patch) | |
tree | 4610122e100cd68bf76ee04c69d3b18bc91b9b1a /dlltest.cpp | |
parent | d94c78949fee98200162462e9e8d37c9287a9d95 (diff) | |
download | cryptopp-4a2b40dd704e7763a00a174dac932f0cf14d01d3.tar.gz |
fix wrong error message in FIPS140_SampleApplication
fix DLL startup problem on Windows 9x
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@100 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'dlltest.cpp')
-rw-r--r-- | dlltest.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/dlltest.cpp b/dlltest.cpp index 5a49513..ae7e1c3 100644 --- a/dlltest.cpp +++ b/dlltest.cpp @@ -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() |