diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 20:31:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 20:31:39 +0300 |
commit | cddcd7483a7c472598af098e759e5d309024f606 (patch) | |
tree | b0a227d6e087c41958cc84d27bc323353248aae5 /src/core/stdcrypt | |
parent | 1039b2829a264280493ba0fa979214fe024dc70c (diff) |
DWORD -> uint32_t
Diffstat (limited to 'src/core/stdcrypt')
-rw-r--r-- | src/core/stdcrypt/src/stdcrypt.h | 4 | ||||
-rw-r--r-- | src/core/stdcrypt/src/utils.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
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;
}
|