summaryrefslogtreecommitdiff
path: root/fipstest.cpp
diff options
context:
space:
mode:
authorMarcel Raad <MarcelRaad@users.noreply.github.com>2017-07-17 18:10:38 +0200
committerJeffrey Walton <noloader@gmail.com>2017-07-17 12:10:38 -0400
commitd9de314e86306ce6dd549ccf6b98a6100c9c7310 (patch)
treefa9689ef80c32a585d3e96c77ad831693f8672e3 /fipstest.cpp
parent50d1ea83144af55e4938b3972dbc365908750fad (diff)
downloadcryptopp-git-d9de314e86306ce6dd549ccf6b98a6100c9c7310.tar.gz
Fix Windows compilation issues (by RaptorFactor) (#444)
* Fix compilation on Windows with /DUNICODE * Fix linking of fipstest for MSVC targeting ARM (__crt_debugger_hook is not available). * Fix build for Clang on Windows with optimizations on. * Fix a warning about a non-existant warning under Clang. * Fix compilation under Intel C++ 18.0 on Windows
Diffstat (limited to 'fipstest.cpp')
-rw-r--r--fipstest.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/fipstest.cpp b/fipstest.cpp
index a7419821..132c6510 100644
--- a/fipstest.cpp
+++ b/fipstest.cpp
@@ -328,21 +328,21 @@ bool IntegrityCheckModule(const char *moduleFilename, const byte *expectedModule
{
std::ostringstream oss;
oss << "Crypto++ DLL loaded at base address 0x" << std::hex << h << ".\n";
- OutputDebugString(oss.str().c_str());
+ OutputDebugStringA(oss.str().c_str());
}
else
{
std::ostringstream oss;
oss << "Crypto++ DLL integrity check may fail. Expected module base address is 0x";
oss << std::hex << g_BaseAddressOfMAC << ", but module loaded at 0x" << h << ".\n";
- OutputDebugString(oss.str().c_str());
+ OutputDebugStringA(oss.str().c_str());
}
#endif
if (!moduleStream)
{
#ifdef CRYPTOPP_WIN32_AVAILABLE
- OutputDebugString("Crypto++ DLL integrity check failed. Cannot open file for reading.");
+ OutputDebugStringA("Crypto++ DLL integrity check failed. Cannot open file for reading.");
#endif
return false;
}
@@ -400,7 +400,7 @@ bool IntegrityCheckModule(const char *moduleFilename, const byte *expectedModule
}
}
-#if defined(_MSC_VER) && _MSC_VER >= 1400
+#if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_M_ARM)
// first byte of _CRT_DEBUGGER_HOOK gets modified in memory by the debugger invisibly, so read it from file
if (IsDebuggerPresent())
{
@@ -436,7 +436,7 @@ bool IntegrityCheckModule(const char *moduleFilename, const byte *expectedModule
// hash from disk instead
if (!VerifyBufsEqual(expectedModuleMac, actualMac, macSize))
{
- OutputDebugString("Crypto++ DLL in-memory integrity check failed. This may be caused by debug breakpoints or DLL relocation.\n");
+ OutputDebugStringA("Crypto++ DLL in-memory integrity check failed. This may be caused by debug breakpoints or DLL relocation.\n");
moduleStream.clear();
moduleStream.seekg(0);
verifier.Initialize(MakeParameters(Name::OutputBuffer(), ByteArrayParameter(actualMac, (unsigned int)actualMac.size())));
@@ -455,7 +455,7 @@ bool IntegrityCheckModule(const char *moduleFilename, const byte *expectedModule
#ifdef CRYPTOPP_WIN32_AVAILABLE
std::string hexMac;
HexEncoder(new StringSink(hexMac)).PutMessageEnd(actualMac, actualMac.size());
- OutputDebugString((("Crypto++ DLL integrity check failed. Actual MAC is: " + hexMac) + ".\n").c_str());
+ OutputDebugStringA((("Crypto++ DLL integrity check failed. Actual MAC is: " + hexMac) + ".\n").c_str());
#endif
return false;
}