diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 16:39:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 16:39:04 +0300 |
commit | 62a186697df33c96dc1a6dac0f4dfc38652fb96f (patch) | |
tree | 1437d0906218fae8827aed384026f2b7e656f4ac /protocols/Steam/src | |
parent | fcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff) |
BYTE -> uint8_t
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r-- | protocols/Steam/src/steam_crypt.cpp | 12 | ||||
-rw-r--r-- | protocols/Steam/src/steam_login.cpp | 2 | ||||
-rw-r--r-- | protocols/Steam/src/steam_polling.cpp | 2 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.h | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/protocols/Steam/src/steam_crypt.cpp b/protocols/Steam/src/steam_crypt.cpp index 28cc21f6f5..dd07cb7e32 100644 --- a/protocols/Steam/src/steam_crypt.cpp +++ b/protocols/Steam/src/steam_crypt.cpp @@ -2,7 +2,7 @@ #pragma comment(lib, "crypt32.lib") -int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, BYTE *encryptedData, DWORD &encryptedSize) +int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, uint8_t *encryptedData, DWORD &encryptedSize) { DWORD cchModulus = (DWORD)mir_strlen(pszModulus); int result; @@ -18,7 +18,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char } // allocate a new buffer. - mir_ptr<BYTE> pbBuffer((BYTE *)mir_alloc(cbLen)); + mir_ptr<uint8_t> pbBuffer((uint8_t *)mir_alloc(cbLen)); if (!CryptStringToBinaryA(pszModulus, cchModulus, CRYPT_STRING_HEX, pbBuffer, &cbLen, &dwSkip, &dwFlags)) { result = GetLastError(); __leave; @@ -26,7 +26,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char // reverse byte array, because of microsoft for (int i = 0; i < (int)(cbLen / 2); ++i) { - BYTE temp = pbBuffer[cbLen - i - 1]; + uint8_t temp = pbBuffer[cbLen - i - 1]; pbBuffer[cbLen - i - 1] = pbBuffer[i]; pbBuffer[i] = temp; } @@ -39,7 +39,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char // Move the key into the key container. DWORD cbKeyBlob = sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY) + cbLen; - mir_ptr<BYTE> pKeyBlob((BYTE *)mir_alloc(cbKeyBlob)); + mir_ptr<uint8_t> pKeyBlob((uint8_t *)mir_alloc(cbKeyBlob)); // Fill in the data. PUBLICKEYSTRUC *pPublicKey = (PUBLICKEYSTRUC *)pKeyBlob.get(); @@ -56,7 +56,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char // Copy the modulus into the blob. Put the modulus directly after the // RSAPUBKEY structure in the blob. - BYTE *pKey = (BYTE *)(((BYTE *)pRsaPubKey) + sizeof(RSAPUBKEY)); + uint8_t *pKey = (uint8_t *)(((uint8_t *)pRsaPubKey) + sizeof(RSAPUBKEY)); memcpy(pKey, pbBuffer, cbLen); // Now import public key @@ -84,7 +84,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char // reverse byte array again for (int i = 0; i < (int)(encryptedSize / 2); ++i) { - BYTE temp = encryptedData[encryptedSize - i - 1]; + uint8_t temp = encryptedData[encryptedSize - i - 1]; encryptedData[encryptedSize - i - 1] = encryptedData[i]; encryptedData[i] = temp; } diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp index 63bb9a3158..9e7e998610 100644 --- a/protocols/Steam/src/steam_login.cpp +++ b/protocols/Steam/src/steam_login.cpp @@ -73,7 +73,7 @@ void CSteamProto::OnGotRsaKey(const JSONNode &root, void *) return; } - BYTE *encryptedPassword = (BYTE *)mir_calloc(encryptedSize); + uint8_t *encryptedPassword = (uint8_t *)mir_calloc(encryptedSize); if ((error = RsaEncrypt(modulus.c_str(), exponent, szPassword, encryptedPassword, encryptedSize)) != 0) { debugLogA(__FUNCTION__ ": encryption error (%lu)", error); SetStatus(ID_STATUS_OFFLINE); diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index 9b56e4787e..3b526975b5 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -107,7 +107,7 @@ void CSteamProto::ParsePollData(const JSONNode &data) if (!getBool("ShowChatEvents", true)) continue; - BYTE bEventType = STEAM_DB_EVENT_CHATSTATES_GONE; + uint8_t bEventType = STEAM_DB_EVENT_CHATSTATES_GONE; DBEVENTINFO dbei = {}; dbei.pBlob = &bEventType; dbei.cbBlob = 1; diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index aec2210c51..8e4596c8ae 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -242,7 +242,7 @@ protected: static WORD SteamToMirandaStatus(PersonaState state);
static PersonaState MirandaToSteamState(int status);
- static int RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, BYTE *encrypted, DWORD &encryptedSize);
+ static int RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, uint8_t *encrypted, DWORD &encryptedSize);
static void ShowNotification(const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
static void ShowNotification(const wchar_t *caption, const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
|