summaryrefslogtreecommitdiffstats
path: root/src/mbedTLS++/AesCfb128Decryptor.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-28 14:34:57 +0200
committerGitHub <noreply@github.com>2021-03-28 14:34:57 +0200
commit5123850db075b69272700b32314dc9b04e0b43b3 (patch)
tree35d68728a4550f760241804442c08f0e9db91484 /src/mbedTLS++/AesCfb128Decryptor.cpp
parentUpdate Copyright year (#5165) (diff)
downloadcuberite-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++/AesCfb128Decryptor.cpp')
-rw-r--r--src/mbedTLS++/AesCfb128Decryptor.cpp8
1 files changed, 4 insertions, 4 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);