summaryrefslogtreecommitdiff
path: root/dlltest.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-07-18 03:19:37 +0000
committerweidai <weidai11@users.noreply.github.com>2003-07-18 03:19:37 +0000
commit41230ef866adb4451ae5987155f8cea3779a9767 (patch)
tree4610122e100cd68bf76ee04c69d3b18bc91b9b1a /dlltest.cpp
parent37db5ab1344e11627a0573ae3b80c31128097bab (diff)
downloadcryptopp-git-41230ef866adb4451ae5987155f8cea3779a9767.tar.gz
fix wrong error message in FIPS140_SampleApplication
fix DLL startup problem on Windows 9x
Diffstat (limited to 'dlltest.cpp')
-rw-r--r--dlltest.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/dlltest.cpp b/dlltest.cpp
index 5a49513d..ae7e1c37 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()