From cddcd7483a7c472598af098e759e5d309024f606 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 20:31:39 +0300 Subject: DWORD -> uint32_t --- src/core/stdcrypt/src/stdcrypt.h | 4 ++-- src/core/stdcrypt/src/utils.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/stdcrypt') diff --git a/src/core/stdcrypt/src/stdcrypt.h b/src/core/stdcrypt/src/stdcrypt.h index 03a10bcd83..6a0e240b45 100644 --- a/src/core/stdcrypt/src/stdcrypt.h +++ b/src/core/stdcrypt/src/stdcrypt.h @@ -29,8 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc., struct ExternalKey { uint8_t m_key[KEY_LENGTH]; - DWORD m_crc32; - uint8_t slack[BLOCK_SIZE - sizeof(DWORD)]; + uint32_t m_crc32; + uint8_t slack[BLOCK_SIZE - sizeof(uint32_t)]; }; struct CStdCrypt : public MICryptoEngine, public MZeroedObject diff --git a/src/core/stdcrypt/src/utils.cpp b/src/core/stdcrypt/src/utils.cpp index bb334edbdb..ab8dbfb95a 100644 --- a/src/core/stdcrypt/src/utils.cpp +++ b/src/core/stdcrypt/src/utils.cpp @@ -31,7 +31,7 @@ bool getRandomBytes(uint8_t *buf, size_t bufLen) ::CryptAcquireContext(&hProvider, nullptr, MS_STRONG_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT) || ::CryptAcquireContext(&hProvider, nullptr, nullptr, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { - ::CryptGenRandom(hProvider, DWORD(bufLen), buf); + ::CryptGenRandom(hProvider, uint32_t(bufLen), buf); ::CryptReleaseContext(hProvider, 0); } // no luck? try to use Windows NT RTL @@ -41,7 +41,7 @@ bool getRandomBytes(uint8_t *buf, size_t bufLen) if (fnGetRandom == nullptr) return false; - fnGetRandom(buf, DWORD(bufLen)); + fnGetRandom(buf, uint32_t(bufLen)); } return true; } -- cgit v1.2.3