From 5123850db075b69272700b32314dc9b04e0b43b3 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 28 Mar 2021 13:34:57 +0100 Subject: Fix Windows XP to 7 compatibility (#5167) * Partially reverts 01a4e696b * Unify thread names - Remove use of GetThreadId API --- src/mbedTLS++/AesCfb128Decryptor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mbedTLS++/AesCfb128Decryptor.cpp') diff --git a/src/mbedTLS++/AesCfb128Decryptor.cpp b/src/mbedTLS++/AesCfb128Decryptor.cpp index 6243a3ded..3efe95dbe 100644 --- a/src/mbedTLS++/AesCfb128Decryptor.cpp +++ b/src/mbedTLS++/AesCfb128Decryptor.cpp @@ -13,7 +13,7 @@ cAesCfb128Decryptor::cAesCfb128Decryptor(void) : m_IsValid(false) { -#ifdef _WIN32 +#if PLATFORM_CRYPTOGRAPHY && defined(_WIN32) if (!CryptAcquireContext(&m_Aes, nullptr, nullptr, PROV_RSA_AES, CRYPT_VERIFYCONTEXT)) { throw std::system_error(GetLastError(), std::system_category()); @@ -30,7 +30,7 @@ cAesCfb128Decryptor::cAesCfb128Decryptor(void) : cAesCfb128Decryptor::~cAesCfb128Decryptor() { // Clear the leftover in-memory data, so that they can't be accessed by a backdoor: -#ifdef _WIN32 +#if PLATFORM_CRYPTOGRAPHY && defined(_WIN32) CryptReleaseContext(m_Aes, 0); #else mbedtls_aes_free(&m_Aes); @@ -45,7 +45,7 @@ void cAesCfb128Decryptor::Init(const Byte a_Key[16], const Byte a_IV[16]) { ASSERT(!IsValid()); // Cannot Init twice -#ifdef _WIN32 +#if PLATFORM_CRYPTOGRAPHY && defined(_WIN32) struct Key { PUBLICKEYSTRUC Header; @@ -77,7 +77,7 @@ void cAesCfb128Decryptor::ProcessData(std::byte * const a_EncryptedIn, const siz { ASSERT(IsValid()); // Must Init() first -#ifdef _WIN32 +#if PLATFORM_CRYPTOGRAPHY && defined(_WIN32) ASSERT(a_Length <= std::numeric_limits::max()); DWORD Length = static_cast(a_Length); -- cgit v1.2.3