diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-03-28 14:34:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-28 14:34:57 +0200 |
commit | 5123850db075b69272700b32314dc9b04e0b43b3 (patch) | |
tree | 35d68728a4550f760241804442c08f0e9db91484 /src/mbedTLS++ | |
parent | Update Copyright year (#5165) (diff) | |
download | cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.gz cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.bz2 cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.lz cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.xz cuberite-5123850db075b69272700b32314dc9b04e0b43b3.tar.zst cuberite-5123850db075b69272700b32314dc9b04e0b43b3.zip |
Diffstat (limited to 'src/mbedTLS++')
-rw-r--r-- | src/mbedTLS++/AesCfb128Decryptor.cpp | 8 | ||||
-rw-r--r-- | src/mbedTLS++/AesCfb128Decryptor.h | 4 |
2 files changed, 6 insertions, 6 deletions
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<DWORD>::max()); DWORD Length = static_cast<DWORD>(a_Length); diff --git a/src/mbedTLS++/AesCfb128Decryptor.h b/src/mbedTLS++/AesCfb128Decryptor.h index a2c9d6a05..1fee2bbba 100644 --- a/src/mbedTLS++/AesCfb128Decryptor.h +++ b/src/mbedTLS++/AesCfb128Decryptor.h @@ -9,7 +9,7 @@ #pragma once -#ifdef _WIN32 +#if PLATFORM_CRYPTOGRAPHY && defined(_WIN32) #include <wincrypt.h> #else #include "mbedtls/aes.h" @@ -38,7 +38,7 @@ public: protected: -#ifdef _WIN32 +#if PLATFORM_CRYPTOGRAPHY && defined(_WIN32) HCRYPTPROV m_Aes; HCRYPTKEY m_Key; #else |